I'm trying to optimize my apache and nginx installations and have been looking for information on how to setup correct number or min/max servers and connections in Apache and worker processes in Nginx.
I was wondering whether or not Apache and Nginx take advantage of multy core processors and how to set configuration in Apache and Nginx?
For example, lets say I have a 4 core processor, should I set workers to 4 in nginx? what should I set spare server in apache to?
I see a lot of 408 errors in my apache2 logs.
I increased RequestReadTimeout and KeepAliveTimout but errors are still there.
The errors look like this:
xx.xx.xx.xx - - [05/Dec/2012:19:33:56 +0100] "-" 408 4561 "-" "-"
xx.xx.xx.xx - - [05/Dec/2012:19:33:56 +0100] "-" 408 4561 "-" "-"
I heard that these errors are related to Chrome optimization and some users did reported our site returning 408 internal error.
It is interesting that we get two 408 error from same IP in sequence then it that IP start working.
I always have impressions to those who got admitted into top Universities like MIT, Standford... for studying Engineering. I don't actually know what they are doing in the University or what they will do, but I always feel they can perform higher level tasks with more complexities. I always think that they are good at create and applying mathematical model in real life and I tend to agree: If you can't apply math, it's your problems, not math.
I am a junior software engineer on embedded devices. I am learning more on Linux kernel and low level stuffs. Even so, my will is not strong enough to pursue technical path forever, with a final purpose is to create something significant on my own.
May I have a chance to get on their level if I keep learning through experience and self-study? In my opinion, Math is the must have requirement, since it seems that programs on those Universities are very Math oriented. Without very strong math skill, how can one perform good in science and researching beyond making regular business products?
I need to apply an impulse on a object with a particular force and at a particular angle in Box2d. If I am right the syntax would be the following:
body.GetBody().ApplyImpulse(new b2Vec2(direction,
power),body.GetBody().GetWorldCenter());
The problem is my direction is in angles. I found a discussion where it was said that the way we can convert an angle into a vector would be as:
new b2Vec2(Math.cos(angle*Math.PI/180),Math.sin(angle*Math.PI/180));
Now I am not sure how to combine these two. In other words, if I wish to apply a force of 30 units at an angle of 30 degrees at the center of the object, how should I do it?
Bonjour,
Citation:
CloudStack est un logiciel de cloud computing open source pour la création, la gestion et le déploiement de services de cloud d'infrastructure. Il utilise des hyperviseurs existants tels que KVM, vSphere, XenServer et / XCP pour la virtualisation. En plus de sa propre API, CloudStack prend également en charge les Amazon Web Services. Voici une série de tests effectués par Ikoula sur ce logiciel.
Je vous présente ce troisième tutoriel sur Cloudstack:Déploiement...
I'm basically looking for a way to allow for secure, but password-less authentication to SVN through WebDAV (I would rather not use svn+ssh.) I know this is possible with SSH, is it possible with Apache Authentication too?
Sortie de Debian 6.0.0 Squeeze
Le Debian Project l'avait annoncé ce 31 janvier 2011, la sortie officielle de Debian 6.0, plus connue sous le nom de Squeeze l'extraterrestre à 3 yeux, était iminente.
Et bien, c'est chose faite ! Le passage en version stable de Squeeze a eu lieu ce week-end et pour l'occasion, le site web du projet a subi un rajeunissement.
Citation:
Envoyé par [email protected]
Release Manage...
I have a Social Networking site that runs on a single LAMP Server that handles everything.
The average RAM usage per Apache process is 43 MB.
Is that amount roughly within the expected range for a Social Networking site, or is it too high?
If it's too high, where and how can I look to bring that average number down?
(If you need more details to determine whether it's within the expected range or not, just let me know and I'll edit my question to provide them as best I can.)
I have an Apache server that serves up mercurial repositories and it currently authenticates using ldap credentials.
I want to permit a single user (to start with) to use a SSL client certificate, with all remaining users still able to use the ldap credentials authentication method.
I have looked through Stack Overflow and other wider (google) searches but can not find information/guidance on how to set this up.
Hi All,
I am for an application which extracts information from facebook search, hence i require to login facebook. i have registered my application in facebook developers site and have got api key and secret key. in my code i am getting an exception when i am trying to login. Here is my code for login to facebook:
import com.facebook.api.FacebookRestClient;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpState;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpClientParams;
public class FaceLogin {
public FaceLogin(){
getUserID("username", "password");
}
private static void getUserID(String email, String password)
{
String session = null;
try {
HttpClient http = new HttpClient();
http.setParams(new HttpClientParams()); //http.getHostConfiguration().setHost("http://www.facebook.com/");
http.setState(new HttpState());
String api_key = "****some key****";
String secret = "****some key****";
FacebookRestClient client = new FacebookRestClient(api_key, secret);
client.setIsDesktop(true);
String token = client.auth_createToken();
final String loginId = "http://www.facebook.com/login.php";
GetMethod get = new GetMethod(loginId + "?api_key=" + api_key + "&v=1.0&auth_token=" +token);
System.out.println("Get="+get);
http.executeMethod(get);
PostMethod post = new PostMethod(loginId);
post.addParameter(new NameValuePair("api_key", api_key));
post.addParameter(new NameValuePair("v", "1.0"));
post.addParameter(new NameValuePair("auth_token", token));
post.addParameter(new NameValuePair("fbconnect","true"));
post.addParameter(new NameValuePair("return_session","true"));
post.addParameter(new NameValuePair("session_key_only","true"));
post.addParameter(new NameValuePair("req_perms","read_stream,publish_stream"));
post.addParameter(new NameValuePair("lsd","8HYdi"));
post.addParameter(new NameValuePair("locale","en_US"));
post.addParameter(new NameValuePair("persistent","1"));
post.addParameter(new NameValuePair("email", email));
post.addParameter(new NameValuePair("pass", password));
System.out.println("Token ="+token);
int postStatus = http.executeMethod(post);
System.out.println("Response : " + postStatus);
session = client.auth_getSession(token); // Here I am getting error
System.out.println("Session string: " + session);
long userid = client.users_getLoggedInUser();
System.out.println("User Id is : " + userid);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String k[])
{
FaceLogin facebookLoginObj=new FaceLogin();
}
}
I am getting the following exception:
org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
WARNING: Cookie rejected: "$Version=0; $Domain=deleted; $Path=/; $Domain=.facebook.com". Cookie name may not start with $
Response : 200
Jun 8, 2010 2:07:36 PM org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
WARNING: Cookie rejected: "$Version=0; $Path=deleted; $Path=/; $Domain=.facebook.com".
Cookie name may not start with $
Facebook returns error code 100
com.facebook.api.FacebookException: Invalid parameter
- v - 1.0
at com.facebook.api.FacebookRestClient.callMethod(FacebookRestClient.java:828)
- auth_token - 004e90dc8818d5f0921d1065d24508d3
at com.facebook.api.FacebookRestClient.callMethod(FacebookRestClient.java:606)
- method - facebook.auth.getSession
- call_id - 1275986256796
- api_key - f7cb1e48c383ef599da9021fc4dec322
at com.facebook.api.FacebookRestClient.auth_getSession(FacebookRestClient.java:1891)
at facebookcrawler.FacebookLogin.getUserID(FacebookLogin.java:81)
at facebookcrawler.FacebookLogin.( - sig - 9344ec75b74a0a87bcae645046d45da8
FacebookLogin.java:24)
at facebookcrawler.FaceLogin.main(FaceLogin.java:80)
Here may be the problem is for creating session, i searched for all the solutions on net but could not helped me to get login.
Please help me if you can suggest me some way to resolve this problem. i thanks to all your valuable suggestion.
i develop a app using struts2, spring 3.1, Jpa2 and Hibernate. From Spring i use transactions and IoC.
so, i have an ajax code block that calls for a struts2 action every second (this is happening for every user that is logged into application (simultaneous users are around 20-30 at a time)). this action name is PopupAction
public class PopupAction extends VActionBase implements ServletRequestAware {
private static final long serialVersionUID = -293004532677112584L;
private iIntermedService intermedService;
private HttpServletRequest servletRequest;
@Override
public String execute() {
Integer agentId = (Integer) session.get("USER_AGENT_ID");
Intermed iObj;
try {
iObj = intermedService.getIntermed(agentId,locationsString);
} catch (Exception e) {
logger.error("Cannot get Intermed!!! "+e.getMessage());
return ERROR;
}
return SUCCESS;
}
}
and then i have the service class :
@Transactional(readOnly=true)
public class IntermedServiceImpl extends GenericIService<Intermed, Integer> implements iIntermedService {
@Override
public Intermed getIntermed (int agentId,String queueIds) throws Exception {
Intermed intermedObj = null;
//TODO - find a better implementation for this queueIds parameter!!!!
try{
String sql = "SELECT i FROM bla bla bla.....)";
Query q = this.em.createQuery(sql);
List<Intermed> iList = q.getResultList();
if (iList.size() == 1){
intermedObj = (Intermed) iList.get(0);
//get latest object from DB
em.refresh(intermedObj);
}
}catch(Exception e){
e.printStackTrace();
logger.error(e.getCause()+e.getMessage());
throw e;
}
return intermedObj;
}
}
here is the spring configuration :
<bean id="emfI" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="inboundDS" />
<property name="persistenceUnitName" value="I2PU"/>
<!-- GlassFish load-time weaving setup -->
<property name="loadTimeWeaver">
<bean class="org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver"/>
</property>
</bean>
<tx:annotation-driven transaction-manager="txManagerI" />
<tx:advice id="txManagerInboundAdvice" transaction-manager="txManagerI">
<tx:attributes>
<tx:method name="*" rollback-for="java.lang.Exception"/>
</tx:attributes>
</tx:advice>
I have names for transactionManager because i have 3 datasources and 3 transaction managers.
the problem is that my glassfish logs are full of messages like these:
-- removed in order to be able to add more recent logs --
So the cause is : Caused by: java.lang.IllegalStateException: Transaction not active.
But i have no idea what can cause this.
Any help ?
thanks
Updates
So i have added to @Transactional annotation the transaction manager name that he has to use, but this still does not solved my problem. I have captured a log from the time that the transaction is created until i got that exception:
2012-02-08T15:08:55.954+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractBeanFactory.java:245) - Returning cached instance of singleton bean 'txManagerVA'
2012-02-08T15:08:55.962+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractPlatformTransactionManager.java:365) - Creating new transaction with name [xxx.vs.common.services.inbound.IntermedServiceImpl.getIntermed]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly; '',-java.lang.Exception
2012-02-08T15:08:55.967+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (JpaTransactionManager.java:368) - Opened new EntityManager [org.hibernate.ejb.EntityManagerImpl@edf83f9] for JPA transaction
2012-02-08T15:08:55.976+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (JpaTransactionManager.java:400) - Exposing JPA transaction as JDBC transaction [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@725b979b]
2012-02-08T15:08:55.977+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:193) - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@4fb57177] for key [com.sun.gjc.spi.jdbc40.DataSource40@75fa4851] to thread [thread-pool-1-80(80)]
2012-02-08T15:08:55.978+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:193) - Bound value [org.springframework.orm.jpa.EntityManagerHolder@112c6483] for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@47d4f12f] to thread [thread-pool-1-80(80)]
2012-02-08T15:08:55.979+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:272) - Initializing transaction synchronization
2012-02-08T15:08:55.980+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionAspectSupport.java:362) - Getting transaction for [xxx.vs.common.services.inbound.IntermedServiceImpl.getIntermed]
2012-02-08T15:08:55.983+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (ExtendedEntityManagerCreator.java:423) - Starting resource local transaction on application-managed EntityManager [org.hibernate.ejb.EntityManagerImpl@46d002f4]
2012-02-08T15:08:55.984+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:193) - Bound value [org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerSynchronization@797add43] for key [org.hibernate.ejb.EntityManagerImpl@46d002f4] to thread [thread-pool-1-80(80)]
2012-02-08T15:08:55.986+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (ExtendedEntityManagerCreator.java:400) - Joined local transaction
2012-02-08T15:08:55.991+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionAspectSupport.java:391) - Completing transaction for [xxx.vs.common.services.inbound.IntermedServiceImpl.getIntermed]
2012-02-08T15:08:55.992+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractPlatformTransactionManager.java:922) - Triggering beforeCommit synchronization
2012-02-08T15:08:55.994+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractPlatformTransactionManager.java:935) - Triggering beforeCompletion synchronization
2012-02-08T15:08:56.001+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:243) - Removed value [org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerSynchronization@797add43] for key [org.hibernate.ejb.EntityManagerImpl@46d002f4] from thread [thread-pool-1-80(80)]
2012-02-08T15:08:56.002+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractPlatformTransactionManager.java:752) - Initiating transaction commit
2012-02-08T15:08:56.003+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (JpaTransactionManager.java:507) - Committing JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@edf83f9]
2012-02-08T15:08:56.008+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractPlatformTransactionManager.java:948) - Triggering afterCommit synchronization
2012-02-08T15:08:56.010+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (AbstractPlatformTransactionManager.java:964) - Triggering afterCompletion synchronization
2012-02-08T15:08:56.011+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:331) - Clearing transaction synchronization
2012-02-08T15:08:56.012+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:243) - Removed value [org.springframework.orm.jpa.EntityManagerHolder@112c6483] for key [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@47d4f12f] from thread [thread-pool-1-80(80)]
2012-02-08T15:08:56.021+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (TransactionSynchronizationManager.java:243) - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@4fb57177] for key [com.sun.gjc.spi.jdbc40.DataSource40@75fa4851] from thread [thread-pool-1-80(80)]
2012-02-08T15:08:56.021+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (JpaTransactionManager.java:593) - Closing JPA EntityManager [org.hibernate.ejb.EntityManagerImpl@edf83f9] after transaction
2012-02-08T15:08:56.022+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|DEBUG [thread-pool-1-80(80)] (EntityManagerFactoryUtils.java:343) - Closing JPA EntityManager
2012-02-08T15:08:56.023+0200|INFO||_ThreadID=184;_ThreadName=Thread-5;|ERROR [thread-pool-1-80(80)] (PopupAction.java:39) - Cannot get Intermed!!! Transaction not active; nested exception is java.lang.IllegalStateException: Transaction not active
2012-02-08T15:08:56.024+0200|SEVERE||_ThreadID=184;_ThreadName=Thread-5;|org.springframework.dao.InvalidDataAccessApiUsageException: Transaction not active; nested exception is java.lang.IllegalStateException: Transaction not active
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:298)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:106)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerSynchronization.convertException(ExtendedEntityManagerCreator.java:501)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerSynchronization.afterCommit(ExtendedEntityManagerCreator.java:481)
at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCommit(TransactionSynchronizationUtils.java:133)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerAfterCommit(TransactionSynchronizationUtils.java:121)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCommit(AbstractPlatformTransactionManager.java:950)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:796)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy325.getIntermed(Unknown Source)
at xxx.vs.common.actions.PopupAction.execute(PopupAction.java:37)
at sun.reflect.GeneratedMethodAccessor1581.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at xxx.vs.common.utils.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:78)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.googlecode.sslplugin.interceptors.SSLInterceptor.intercept(SSLInterceptor.java:128)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina
2012-02-08T15:08:56.024+0200|SEVERE||_ThreadID=184;_ThreadName=Thread-5;|.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.IllegalStateException: Transaction not active
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:69)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerSynchronization.afterCommit(ExtendedEntityManagerCreator.java:478)
... 93 more
so again..... any ideea ?
I have a problem with p:dataTable in Primefaces, I can not find the error.
Class UsuarioAsig:
public class UsuarioAsig {
private BigDecimal codigopersona;
private String nombre;
private String paterno;
private String materno;
private String login;
private String observacion;
private String tipocontrol;
private String externo;
private String habilitado;
private String nombreperfil;
private BigDecimal codigousuario; ...get and set...}
Class UsuarioAsigListaDataModel:
public class UsuarioAsigListaDataModel extends ListDataModel<UsuarioAsig> implements SelectableDataModel<UsuarioAsig> {
public UsuarioAsigListaDataModel(){}
public UsuarioAsigListaDataModel(List<UsuarioAsig> data){super(data);}
@Override
public UsuarioAsig getRowData(String rowKey) {
@SuppressWarnings("unchecked")
List<UsuarioAsig> listaUsuarioAsigLectura = (List<UsuarioAsig>) getWrappedData();
for (UsuarioAsig usuarioAsig : listaUsuarioAsigLectura) {
if (usuarioAsig.getCodigopersona().equals(rowKey)) { return usuarioAsig; }
}
return null;
}
@Override
public Object getRowKey(UsuarioAsig usuarioAsig) {
return usuarioAsig.getCodigopersona();
}}
Controller UsuarioAsigController:
@Controller("usuarioAsigController")
@Scope(value = "session")
public class UsuarioAsigController {
private List<UsuarioAsig> listaUsuarioAsig;
private HashMap<String, Object> selUsuarioAsig;
private UsuarioAsigListaDataModel mediumUsuarioAsigModel;
@Autowired
UsuarioService usuarioService;
...
public List<UsuarioAsig> getListaUsuarioAsig() {
listaUsuarioAsig = usuarioService.selectAsig();
return listaUsuarioAsig;
}
public void setListaUsuarioAsig(List<UsuarioAsig> listaUsuarioAsig) {
this.listaUsuarioAsig = listaUsuarioAsig;
}
public void setMediumUsuarioAsigModel(UsuarioAsigListaDataModel mediumUsuarioAsigModel) {
this.mediumUsuarioAsigModel = mediumUsuarioAsigModel;
}
public UsuarioAsigListaDataModel getMediumUsuarioAsigModel() {
listaUsuarioAsig = usuarioService.selectAsig();
mediumUsuarioAsigModel = new UsuarioAsigListaDataModel(listaUsuarioAsig);
return mediumUsuarioAsigModel;
}
public void onRowSelect(SelectEvent event) {
FacesMessage msg = new FacesMessage("Usuario seleccionado", ((UsuarioAsig) event.getObject()).getNombre());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
the error is generated when you click on one of the lines of datatable:
asiginst.xhtml:
<h:form id="form">
<p:growl id="msgs" showDetail="true" />
<p:dataTable id="usuarioAsigListaDataModel" var="usuarioAsig"
value="#{usuarioAsigController.mediumUsuarioAsigModel}"
rowKey="#{usuarioAsig.codigopersona}"
selection="#{usuarioAsigController.selUsuarioAsig}"
selectionMode="single" paginator="true" rows="10">
<p:ajax event="rowSelect"
listener="#{usuarioAsigController.onRowSelect}"
update=":form:msgs" />
<p:column headerText="Código" style="width:10%">#{usuarioAsig.codigopersona}</p:column>
<p:column headerText="Nombre" style="width:32%">#{usuarioAsig.nombre}</p:column>
<p:column headerText="Apellidos" style="width:32%">#{usuarioAsig.paterno} #{usuarioasig.materno}</p:column>
<p:column headerText="Tipo Control" style="width:20%">#{usuarioAsig.tipocontrol}</p:column>
<p:column headerText="Habilitado" style="width:6%">#{usuarioAsig.habilitado}</p:column>
</p:dataTable>
</h:form>
THE ERROR IS GENERATED:
WARNING: asiginst.xhtml @51,103 listener="#{usuarioAsigController.onRowSelect}": java.lang.ClassCastException: java.util.HashMap cannot be cast to com.datos.entidades.qry.UsuarioAsig
javax.el.ELException: asiginst.xhtml @51,103 listener="#{usuarioAsigController.onRowSelect}": java.lang.ClassCastException: java.util.HashMap cannot be cast to com.datos.entidades.qry.UsuarioAsig
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111)
at org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processArgListener(AjaxBehaviorListenerImpl.java:69)
at org.primefaces.behavior.ajax.AjaxBehaviorListenerImpl.processAjaxBehavior(AjaxBehaviorListenerImpl.java:56)
at org.primefaces.event.SelectEvent.processListener(SelectEvent.java:40)
at javax.faces.component.behavior.BehaviorBase.broadcast(BehaviorBase.java:102)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:760)
at javax.faces.component.UIData.broadcast(UIData.java:1071)
at javax.faces.component.UIData.broadcast(UIData.java:1093)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to com.datos.entidades.qry.UsuarioAsig
at com.controller.UsuarioAsigController.onRowSelect(UsuarioAsigController.java:217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.el.parser.AstValue.invoke(AstValue.java:264)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
... 29 more
I have problem with building project with android anotations (v.2.6) using maven, with eclipse all works just fine. Here is some project and error details:
build configuration snippet from pom:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.3.2</version>
<inherited>true</inherited>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>16</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<inherited>true</inherited>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<extensions>true</extensions>
</plugin>
and here is output after executing mvn clean install on parent project:
[INFO] --- maven-compiler-plugin:2.5:compile (default-compile) @ native-container framework ---
[INFO] Compiling 102 source files to /Users/vitaliyzasadnyy/Development/repository/androidcontainer/native-container- android/native-container-framework/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.NullPointerException
[ERROR] at com.googlecode.androidannotations.internal.codemodel.JCodeModel.ref(JCodeModel.java:372)
at com.googlecode.androidannotations.processing.EBeansHolder.refClass(EBeansHolder.java:160)
at com.googlecode.androidannotations.processing.EBeansHolder$Classes.<init>(EBeansHolder.java:50)
at com.googlecode.androidannotations.processing.EBeansHolder.<init>(EBeansHolder.java:136)
at com.googlecode.androidannotations.processing.ModelProcessor.process(ModelProcessor.java:40)
at com.googlecode.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:472)
at com.googlecode.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:343)
at com.googlecode.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:318)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:627)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:556)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:701)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:987)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:559)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:534)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:168)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:678)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) /Users/vitaliyzasadnyy/Development/repository/androidcontainer/native-container-android/native-container-framework/src/main/java/com/nravo/framework/activity/MainScreenActivity.java:[44,-1] Unexpected error. Please report an issue on AndroidAnnotations, with the following content: java.lang.NullPointerException
at com.googlecode.androidannotations.internal.codemodel.JCodeModel.ref(JCodeModel.java:372)
at com.googlecode.androidannotations.processing.EBeansHolder.refClass(EBeansHolder.java:160)
Does anybody faced with this problem?
I try to configure log4j.xml in such a way that file will be rolled upon file size, and the rolled file's name will be i.e: "C:/temp/test/test_log4j-%d{yyyy-MM-dd-HH_mm_ss}.log"
I followed this discussion: http://web.archiveorange.com/archive/v/NUYyjJipzkDOS3reRiMz
Finally it worked for me only when I add:
try {
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
to the method:
public boolean isTriggeringEvent(Appender appender, LoggingEvent event,
String filename, long fileLength)
which make it works.
The question is if there is a better way to make it work?
since this method call many times and slow my program.
Here is the code:
package com.mypack.rolling;
import org.apache.log4j.rolling.RollingPolicy;
import org.apache.log4j.rolling.RolloverDescription;
import org.apache.log4j.rolling.TimeBasedRollingPolicy;
/**
* Same as org.apache.log4j.rolling.TimeBasedRollingPolicy but acts only as
* RollingPolicy and NOT as TriggeringPolicy.
*
* This allows us to combine this class with a size-based triggering policy
* (decision to roll based on size, name of rolled files based on time)
*
*/
public class CustomTimeBasedRollingPolicy implements RollingPolicy {
TimeBasedRollingPolicy timeBasedRollingPolicy = new TimeBasedRollingPolicy();
/**
* Set file name pattern.
* @param fnp file name pattern.
*/
public void setFileNamePattern(String fnp) {
timeBasedRollingPolicy.setFileNamePattern(fnp);
}
/*
public void setActiveFileName(String fnp) {
timeBasedRollingPolicy.setActiveFileName(fnp);
}*/
/**
* Get file name pattern.
* @return file name pattern.
*/
public String getFileNamePattern() {
return timeBasedRollingPolicy.getFileNamePattern();
}
public RolloverDescription initialize(String file, boolean append) throws SecurityException {
return timeBasedRollingPolicy.initialize(file, append);
}
public RolloverDescription rollover(String activeFile) throws SecurityException {
return timeBasedRollingPolicy.rollover(activeFile);
}
public void activateOptions() {
timeBasedRollingPolicy.activateOptions();
}
}
package com.mypack.rolling;
import org.apache.log4j.helpers.OptionConverter;
import org.apache.log4j.Appender;
import org.apache.log4j.rolling.TriggeringPolicy;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.OptionHandler;
/**
* Copy of org.apache.log4j.rolling.SizeBasedTriggeringPolicy but able to accept
* a human-friendly value for maximumFileSize, eg. "10MB"
*
* Note that sub-classing SizeBasedTriggeringPolicy is not possible because that
* class is final
*/
public class CustomSizeBasedTriggeringPolicy implements TriggeringPolicy, OptionHandler {
/**
* Rollover threshold size in bytes.
*/
private long maximumFileSize = 10 * 1024 * 1024; // let 10 MB the default max size
/**
* Set the maximum size that the output file is allowed to reach before
* being rolled over to backup files.
*
* <p>
* In configuration files, the <b>MaxFileSize</b> option takes an long
* integer in the range 0 - 2^63. You can specify the value with the
* suffixes "KB", "MB" or "GB" so that the integer is interpreted being
* expressed respectively in kilobytes, megabytes or gigabytes. For example,
* the value "10KB" will be interpreted as 10240.
*
* @param value
* the maximum size that the output file is allowed to reach
*/
public void setMaxFileSize(String value) {
maximumFileSize = OptionConverter.toFileSize(value, maximumFileSize + 1);
}
public long getMaximumFileSize() {
return maximumFileSize;
}
public void setMaximumFileSize(long maximumFileSize) {
this.maximumFileSize = maximumFileSize;
}
public void activateOptions() {
}
public boolean isTriggeringEvent(Appender appender, LoggingEvent event,
String filename, long fileLength) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
boolean result = (fileLength >= maximumFileSize);
return result;
}
}
and the log4j.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c -> %m%n" />
</layout>
</appender>
<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
<param name="file" value="C:/temp/test/test_log4j.log" />
<rollingPolicy class="com.mypack.rolling.CustomTimeBasedRollingPolicy">
<param name="fileNamePattern" value="C:/temp/test/test_log4j-%d{yyyy-MM-dd-HH_mm_ss}.log" />
</rollingPolicy>
<triggeringPolicy class="com.mypack.rolling.CustomSizeBasedTriggeringPolicy">
<param name="MaxFileSize" value="200KB" />
</triggeringPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c -> %m%n" />
</layout>
</appender>
<logger name="com.mypack.myrun" additivity="false">
<level value="debug" />
<appender-ref ref="FILE" />
</logger>
<root>
<priority value="debug" />
<appender-ref ref="console" />
</root>
</log4j:configuration>
Hi,
I created an GWT project in eclipse. Now I tried to implement openId with using the openid4java library.
I imported the .jar files via properties--java build path:
openid4java-0.9.5.jar
lib/*.jar
In addition I copied the .jar files into the war/WEB-INF/lib directory.
The problem at hand comes up when I call the authenticate() method.
Then I get a:
HTTP ERROR 500
Problem accessing /openid/openid. Reason:
access denied (java.lang.RuntimePermission modifyThreadGroup)Caused by:java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkAccess(DevAppServerFactory.java:191)
at java.lang.ThreadGroup.checkAccess(Unknown Source)
at java.lang.Thread.init(Unknown Source)
at java.lang.Thread.<init>(Unknown Source)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ReferenceQueueThread.<init>(MultiThreadedHttpConnectionManager.java:1039)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.storeReferenceToConnection(MultiThreadedHttpConnectionManager.java:164)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.access$900(MultiThreadedHttpConnectionManager.java:64)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ConnectionPool.createConnection(MultiThreadedHttpConnectionManager.java:750)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:469)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:394)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:152)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at org.openid4java.util.HttpCache.head(HttpCache.java:296)
at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:360)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:229)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:221)
at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:179)
at org.openid4java.discovery.Discovery.discover(Discovery.java:134)
at org.openid4java.discovery.Discovery.discover(Discovery.java:114)
at org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.java:527)
at auth.openid.server.OpenIDServlet.authenticate(OpenIDServlet.java:138)
at auth.openid.server.OpenIDServlet.doGet(OpenIDServlet.java:101)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Here my servlet source:
import com.google.gwt.user.client.rpc.RemoteService;
import org.openid4java.OpenIDException;
import org.openid4java.consumer.ConsumerException;
import org.openid4java.consumer.ConsumerManager;
import org.openid4java.consumer.VerificationResult;
import org.openid4java.discovery.DiscoveryInformation;
import org.openid4java.discovery.Identifier;
import org.openid4java.message.AuthRequest;
import org.openid4java.message.ParameterList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.List;
public final class OpenIDServlet extends HttpServlet implements RemoteService {
private final ConsumerManager manager;
public OpenIDServlet() {
try {
manager = new ConsumerManager();
} catch (ConsumerException e) {
throw new RuntimeException("Error creating consumer manager", e);
}
}
...
private void authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
final String loginString = request.getParameter(nameParameter);
try {
// perform discovery on the user-supplied identifier
List discoveries = manager.discover(loginString);
// attempt to associate with the OpenID provider
// and retrieve one service endpoint for authentication
DiscoveryInformation discovered = manager.associate(discoveries);
// obtain a AuthRequest message to be sent to the OpenID provider
AuthRequest authReq = manager.authenticate(discovered, "openid", null);
// redirect to OpenID for authentication
response.sendRedirect(authReq.getDestinationUrl(true));
}
catch (OpenIDException e) {
throw new ServletException("Login string probably caused an error. loginString = " + loginString, e);
}
}
My question now is:
What could be my fault? Did I make any mistakes in importing the openid4java library? (which?)
All other methods in the servlet which do not use the openid4java implementation work fine.
Thanks,
Andreas
I'm looking to create something that can move randomly inside of a fixed div container. I love the way the object moves in this example that I found searching this website...
http://jsfiddle.net/Xw29r/15/
The code on the jsfiddle contains the following:
$(document).ready(function(){
animateDiv();
});
function makeNewPosition(){
// Get viewport dimensions (remove the dimension of the div)
var h = $(window).height() - 50;
var w = $(window).width() - 50;
var nh = Math.floor(Math.random() * h);
var nw = Math.floor(Math.random() * w);
return [nh,nw];
}
function animateDiv(){
var newq = makeNewPosition();
var oldq = $('.a').offset();
var speed = calcSpeed([oldq.top, oldq.left], newq);
$('.a').animate({ top: newq[0], left: newq[1] }, speed, function(){
animateDiv();
});
};
function calcSpeed(prev, next) {
var x = Math.abs(prev[1] - next[1]);
var y = Math.abs(prev[0] - next[0]);
var greatest = x > y ? x : y;
var speedModifier = 0.1;
var speed = Math.ceil(greatest/speedModifier);
return speed;
}?
CSS:
div.a {
width: 50px;
height:50px;
background-color:red;
position:fixed;
}?
However, I don't believe the code above constricts that object at all. I need my object to move randomly inside of a container that is let's say for now... 1200px in width and 500px in height.
Can someone steer me in the right direction? I'm super new to coding so I'm having a hard time finding an answer on my own.
Thanks so much!
James
I'm working on a medium-sized web application written in PHP that's running on a VPS with 512mb ram. The webapp hasn't been officially launched yet, so there isn't too much traffic going on, just me and a few other people working on it.
There is another slightly smaller webapp also hosted on this machine, among 4-5 other small static sites.
We are running Centos 5 32-bit & cPanel/WHM.
This is the result of running ps aux and, as you can see, it's not using 100% of the RAM. However, on the hypanel overview, it's always shown as using aroun 500MB ram, just for running apache, mysql, and the lowest-memory-footprint versions of the mail server, ftp server etc.
-bash-3.2# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2156 664 ? Ss 12:08 0:00 init [3]
root 1123 0.0 0.0 2260 548 ? S<s 12:08 0:00 /sbin/udevd -d
root 1462 0.0 0.0 1812 568 ? Ss 12:08 0:00 syslogd -m 0
named 1496 0.0 0.0 3808 820 ? Ss 12:08 0:00 nsd
named 1497 0.0 0.0 10672 756 ? S 12:08 0:00 nsd
named 1499 0.0 0.0 3880 584 ? S 12:08 0:00 nsd
root 1514 0.0 0.1 7240 1064 ? Ss 12:08 0:00 /usr/sbin/sshd
root 1522 0.0 0.0 2832 832 ? Ss 12:08 0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
root 1534 0.0 0.1 3712 1328 ? S 12:08 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql -
mysql 1667 0.0 2.9 225680 30884 ? Sl 12:08 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql -
mailnull 1766 0.0 0.1 9352 1100 ? Ss 12:08 0:00 /usr/sbin/exim -bd -q60m
root 1797 0.0 0.0 2156 708 ? Ss 12:08 0:00 /usr/sbin/dovecot
root 1798 0.0 0.0 2632 1012 ? S 12:08 0:00 dovecot-auth
root 1816 0.0 3.0 38580 32456 ? Ss 12:08 0:01 /usr/local/bin/spamd -d --allowed-ips=127.0.0.1 --pidfi
root 1839 0.0 1.6 63200 17496 ? Ss 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL
root 1846 0.0 0.1 5416 1468 ? Ss 12:08 0:00 pure-ftpd (SERVER)
root 1848 0.0 0.1 6212 1244 ? S 12:08 0:00 /usr/sbin/pure-authd -s /var/run/ftpd.sock -r /usr/sbin
root 1856 0.0 0.1 4492 1112 ? Ss 12:08 0:00 crond
root 1864 0.0 0.0 2356 428 ? Ss 12:08 0:00 /usr/sbin/atd
dovecot 1927 0.0 0.1 5196 1952 ? S 12:08 0:00 pop3-login
dovecot 1928 0.0 0.1 5196 1948 ? S 12:08 0:00 pop3-login
dovecot 1929 0.0 0.1 5316 2012 ? S 12:08 0:00 imap-login
dovecot 1930 0.0 0.2 5416 2228 ? S 12:08 0:00 imap-login
root 1939 0.0 0.1 3936 1964 ? S 12:08 0:00 cPhulkd - processor
root 1963 0.0 0.8 15876 8564 ? S 12:08 0:00 cpsrvd (SSL) - waiting for connections
root 1966 0.0 0.7 15172 7748 ? S 12:08 0:00 cpdavd - accepting connections on 2077 and 2078
root 1990 0.0 0.2 5008 3136 ? S 12:08 0:00 queueprocd - wait to process a task
root 2017 0.0 2.9 38580 31020 ? S 12:08 0:00 spamd child
root 2018 0.0 0.5 8904 5636 ? S 12:08 0:00 /usr/bin/perl /usr/local/cpanel/bin/leechprotect
nobody 2021 0.0 3.2 66512 33724 ? S 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 2022 0.0 3.1 67812 33024 ? S 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 2024 0.0 1.9 64364 20680 ? S 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL
root 2027 0.0 0.4 9000 4540 ? S 12:08 0:00 tailwatchd
root 2032 0.0 0.1 4176 1836 ? SN 12:08 0:00 cpanellogd - sleeping for logs
nobody 3096 0.0 1.9 64572 20264 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 3097 0.0 2.8 66008 30136 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 3098 0.0 2.8 65704 29752 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 3099 0.0 3.1 67260 32816 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL
andrei 3448 0.0 0.1 3204 1632 ? S 12:50 0:00 imap
nobody 3537 0.0 1.9 64308 20108 ? S 13:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 3614 0.0 1.9 64576 20628 ? S 13:10 0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody 3615 0.0 1.3 63200 14672 ? S 13:10 0:00 /usr/local/apache/bin/httpd -k start -DSSL
root 3626 0.0 0.2 10232 2964 ? Rs 13:14 0:00 sshd: root@pts/0
root 3648 0.0 0.1 3844 1600 pts/0 Ss 13:14 0:00 -bash
root 3826 0.0 0.0 2532 908 pts/0 R+ 13:21 0:00 ps aux
Lately, without any significant changes to the configuration, the memory usage started peaking and going over 512, causing the virtual server to kill apache, basically murdering our site in the process.
Do you have any idea if this is normal and more resources should be acquired? I don't think... since there isn't too much data or traffic online yet.
I have a simple JAXWS webservice deployed in JBoss. It runs fine with a java client but I'm trying to connect using a Silverlight 3.0 application. I've changed the webservice to use Soap 1.1:
@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http")
public class UserSessionBean implements UserSessionRemote {
...
}
I'm using BasicHttpBinding on the Silverlight client.
There are two issues:
1- When I connect from VisualStudio (2008 and 2010) to create the webservice proxies, the following exception is thrown, but the proxy is generated successfully. This also happens when I try to update the existing web service reference (but it also updates fine).
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/soap+xml; charset=utf-8 Supported ones are: [text/xml]
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:291)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:432)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at org.jboss.wsf.stack.metro.RequestHandlerImpl.doPost(RequestHandlerImpl.java:225)
at org.jboss.wsf.stack.metro.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:82)
at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
2- When I use the proxy to fetch some data from the webservice (even methods with primitive types), I get the following error on Silverlight client:
"An error occurred while trying to make a request to URI 'http://localhost:9090/admintool/UserSessionEJB'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details."
Setting a breakpoint on my java code, I can see that it is not hit when I run the silverlight client, so it is probably a cross domain issue, but I'm not sure how to handle it (I've already created a crossdomain.xml file and put it beside my HTML page hosting the silverlight client).
I appreciate any help!
I am deploying a webapp from eclipse to tomcat. I am having an issue with my application and JNDI lookups. When the app tries to load the JNDI resource I am this stacktrace:
javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at javax.naming.InitialContext.lookup(InitialContext.java:396)
at org.objectweb.carol.jndi.spi.AbsContext.lookup(AbsContext.java:134)
at org.objectweb.carol.jndi.spi.AbsContext.lookup(AbsContext.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.objectweb.carol.jndi.spi.MultiContext.lookup(MultiContext.java:118)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.theriabook.daoflex.JDBCConnection.getDataSource(JDBCConnection.java:61)
at com.theriabook.daoflex.JDBCConnection.getConnection(JDBCConnection.java:73)
at com.aramark.data.UsersDAO.doLogin(UsersDAO.java:751)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878)
at com.farata.remoting.CustomAMFEndpoint.serviceMessage(CustomAMFEndpoint.java:23)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.cti.compiler.env.web.CompilerInvocationInterceptor.doFilter(CompilerInvocationInterceptor.java:25)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
... 41 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
I am really stumped at this error. I am using a WinXP running on a Virtual Machine (VMWare) from a MAC. Any ideas? I have uninstalled/reinstalled tomcat multiple times.
I am writing a cryptography application and need to work with 128 bit numbers.
In addition to standard add, subtract, multiply, divide, and comparisons, I also need a power and modulo function as well.
Does anyone know of a library or other implementation that can do this? If not 128-bit, is there a 64-bit option available?
I want to write a query like this:
SELECT o.OrderId, MAX(o.NegotiatedPrice, o.SuggestedPrice)
FROM Order o
But this isn't how the MAX function works, right? It is an aggregate function so it expects a single parameter and then returns the MAX of all rows. Does anyone know how to do it my way?