[JBoss Seam] - Clustering booking example
by mphansen
Hi,
I'm trying to set up the booking example in a cluster. I have two jboss-4.0.5-ga instances installed (with ejb3-clustered support) and an Apache in front of them.
I have made the following changes to the booking application.
1) It now uses a MySQL database which is shared by the two JBoss servers.
2) added distributable tag to web.xml to enable HTTP session replication
3) added @Clustered annotation to SFSB enable replication
I then test the application in the following way:
1) I hit http://localhost/seam-booking/
2) I find a hotel and starts booking it
3) before confirming the booking I close down the jboss instance serving my request.
4) I confirm my booking
At this point the following stack trace is thrown at me:
| 15:39:45,578 WARN [SessionFactoryObjectFactory] Not found: 8a808083104f5a8f01104f5a91200000
| 15:39:45,593 INFO [Exceptions] no exceptions.xml file found
| 15:39:45,593 ERROR [Exceptions] redirecting to debug page
| java.lang.RuntimeException: java.io.IOException
| at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:367)
| at org.jboss.ejb3.stateful.StatefulBeanContext.getInstance(StatefulBeanContext.java:309)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:77)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.ReplicantsManagerInterceptor.invoke(ReplicantsManagerInterceptor.java:51)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| at $Proxy153.confirm(Unknown Source)
| at org.jboss.seam.example.booking.HotelBooking$$FastClassByCGLIB$$c83b792d.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:73)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
| at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:38)
| 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:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:82)
| at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:51)
| at org.jboss.seam.example.booking.HotelBooking$$EnhancerByCGLIB$$c93c490c.confirm(<generated>)
| 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:585)
| at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
| at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
| at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:87)
| at org.jboss.web.tomcat.tc5.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
| at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
| at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
| at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
| at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.io.IOException
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:107)
| at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:269)
| at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersister.java:196)
| at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.java:172)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:163)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:343)
| at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
| at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:342)
| ... 91 more
| Caused by: java.lang.reflect.InvocationTargetException
| at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:103)
| ... 105 more
| Caused by: java.io.IOException
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:107)
| at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:269)
| at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
| at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
| at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.persister.ObjectInputStreamProxy.readObjectOverride(ObjectInputStreamProxy.java:68)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:343)
| at java.util.HashMap.readObject(HashMap.java:1013)
| ... 109 more
| Caused by: java.lang.reflect.InvocationTargetException
| 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:585)
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:103)
| ... 123 more
| Caused by: java.io.InvalidObjectException: could not resolve session factory during session deserialization [uuid=8a808083104f5a8f01104f5a91200000, name=null]
| at org.hibernate.impl.SessionFactoryImpl.deserialize(SessionFactoryImpl.java:1056)
| at org.hibernate.impl.SessionImpl.readObject(SessionImpl.java:1877)
| ... 128 more
| 15:39:46,265 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
| 15:39:46,265 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
| 15:39:46,281 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/ajax4jsf.jar!/META-INF/a4j.taglib.xml
| 15:39:46,296 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
| 15:39:46,328 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
| 15:39:46,328 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
| 15:39:46,343 ERROR [STDERR] 2007-01-23 15:39:46 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/Programmer/jboss-4.0.5.GA-cluster/server/node1/./tmp/deploy/tmp29336jboss-seam-booking.ear-contents/jboss-seam-booking-ex
| p.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam.taglib.xml
| 15:39:46,546 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
| 15:39:46,546 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
| 15:39:46,546 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.
|
Before shutting down the server I check the tomcat cache and the SFSB cache through the JMX console and it looks consistent (through printDetails).
Does anyone have an idea about what is going on? Am I missing some modifications that has to be done to the application before it is cluster-enabled?
When I login at first I get the following exception but I assumed it has nothing to do with the exception above.
| 15:37:15,109 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: E37E19AA7BEF13F7F9272B96F
| 3AD8242.node2 lastAccessedTime: 1169563021890 version: 2 lastOutdated: 0]
| java.io.NotSerializableException: javax.faces.application.FacesMessage$Severity
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
| at java.util.ArrayList.writeObject(ArrayList.java:569)
| 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:585)
| at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
| at java.util.Hashtable.writeObject(Hashtable.java:813)
| 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:585)
| at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
| at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
| at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
| at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
| at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
| at org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
| at org.jboss.web.tomcat.tc5.session.JBossCacheService.externalizeSession(JBossCacheService.java:1023)
| at org.jboss.web.tomcat.tc5.session.JBossCacheService.putSession(JBossCacheService.java:312)
| at org.jboss.web.tomcat.tc5.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:121)
| at org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1093)
| at org.jboss.web.tomcat.tc5.session.JBossCacheManager.storeSession(JBossCacheManager.java:648)
| at org.jboss.web.tomcat.tc5.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
| at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
| at org.jboss.web.tomcat.tc5.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
| at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
| at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
| at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
| at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005343#4005343
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005343
19 years, 3 months
[JBoss jBPM] - Problem integrating identity component
by srsuarez
I have a terrible headache from this problem, can anyone help me?
We have tried to integrate JBPM with an old application that uses
struts. The struts app doesnt use hibernate, it only use a connection
pool (proxool).
Well, I read the jbpm userguide and in the chapter about the identity
component it's explained how create a new ExpressionAssignmentHandler
class. Thus, I create a new class that read the expression in the xml
and then connect to the struts app db to resolve the correct actor id.
Thats easy. I try the new class with this example...
---
public class MyTask extends TestCase {
public void testTaskAssignment() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition name='estoy cabreado'>" +
" <start-state>" +
" " +
" </start-state>" +
" <task-node name='t'>" +
" " +
" " +
" user(alucia)" +
" " +
" " +
" </task-node>" +
" <end-state name='end' />" +
"</process-definition>"
);
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try
{
ProcessInstance processInstance =
new ProcessInstance(processDefinition);
Token token = processInstance.getRootToken();
token.signal();
assertSame(processDefinition.getNode("t"), token.getNode());
TaskInstance taskInstance = (TaskInstance)
processInstance
.getTaskMgmtInstance()
.getTaskInstances()
.iterator().next();
assertEquals("user46", taskInstance.getActorId() );
taskInstance.end();
assertSame(processDefinition.getNode("end"), token.getNode());
System.out.println("DEBUG: Finaliza el proceso");
}
finally
{
//jbpmContext.close();
}
}
}
---
This raise the excepcion: "javax.servlet.ServletException: couldn't
delete timers for process instance
org.jbpm.graph.exe.ProcessInstance@15b5783'"
But this isnt the problem (at least in this moment). When I try to load
the process definition with jbpm context, I have a problem with the
proxool driver.
Here's the code that increase my headache:
---
public class MyTask extends TestCase {
public void testTaskAssignment() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition name='arghhh'>" +
" <start-state>" +
" " +
" </start-state>" +
" <task-node name='t'>" +
" " +
" " +
" user(alucia)" +
" " +
" " +
" </task-node>" +
" <end-state name='end' />" +
"</process-definition>"
);
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try
{
jbpmContext.deployProcessDefinition(processDefinition);
GraphSession graphSession = jbpmContext.getGraphSession();
ProcessDefinition loadProcess =
graphSession.findLatestProcessDefinition("arghhh");
ProcessInstance processInstance =
new ProcessInstance(loadProcess);
Token token = processInstance.getRootToken();
token.signal();
assertSame(processDefinition.getNode("t"), token.getNode());
TaskInstance taskInstance = (TaskInstance)
processInstance
.getTaskMgmtInstance()
.getTaskInstances()
.iterator().next();
assertEquals("user46", taskInstance.getActorId() );
taskInstance.end();
assertSame(processDefinition.getNode("end"), token.getNode());
jbpmContext.save(processInstance);
}
finally
{
jbpmContext.close();
}
}
}
---
This raise:
java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[...]
Caused by: org.logicalcobwebs.cglib.core.CodeGenerationException:
java.lang.reflect.InvocationTargetException-->null
at
org.logicalcobwebs.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
[...]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
[...]
Caused by: java.lang.LinkageError: duplicate class definition:
$java/lang/Object$$FastClassByCGLIB$$3f697993
at java.lang.ClassLoader.defineClass1(Native Method)
Please HELP. I dont know what to do.
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005337#4005337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005337
19 years, 3 months
[JBoss Portal] - Re: JSF (RI) Portlet deployment on JBoss Portal 2.2.1
by stan.silvert@jboss.com
There are cleaner ways to deal with the tomahawk.jar that would negate you having to add it to your app. But since I don't have a good understanding of your environment, the easiest thing to tell you is that it will work as long as you always use the same version of tomahawk for everything. Sorry I don't have time to go into more detail on that.
I don't think it is impossible to fix your problems, but mixing JSF implementations is an area of research that (to my knowledge) hasn't been explored yet. You aren't the only one to have problems with this though, so I expect that the research will be started some time this year. I know that old tomahawk versions are known to have issues with Sun's JSF.
I don't see why you would ever want to extend the implementation classes of JSF. You should only use the plug points defined in the JSF spec.
Stan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005330#4005330
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005330
19 years, 3 months
[JBoss Seam] - Re: Validation with pageflows
by sonstone
Here is some code:
The beans:
| @Entity
| @Name("payment")
| @Scope(ScopeType.CONVERSATION)
| public class PaymentBean implements Payment {
|
| @NotNull
| @Length(max=12,min=10)
| @Pattern(regex="^[a-zA-Z0-9]+$", message="Must be alphanumeric.")
| private String accountNumber;
|
| public String getAccountNumber() {
| return accountNumber;
| }
|
| public void setAccountNumber(final String accountNumber) {
| System.out.println("Setting accountNumber to: " + accountNumber);
| this.accountNumber = accountNumber;
| }
|
| @Begin(join=true)
| public void begin()
| {
| System.out.println("PaymentBean.begin()");
| }
|
| }
|
| @Name("paymentAction")
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| public class PaymentActionBean implements PaymentAction {
|
| @In(create=true)
| @Valid
| private Payment payment;
|
| @Create @Begin(join=true)
| public void begin()
| {
| System.out.println("PaymentActionBean.begin()");
| }
|
| @Remove
| @Destroy
| public void destroy() {
| System.out.println("PaymentActionBean.destroy()");
| }
|
| @IfInvalid(outcome = Outcome.REDISPLAY)
| public void doAuthenticate()
| {
| System.out.println(payment.getAccountNumber());
| System.out.println("I am authenticating");
| }
|
| ...
| }
|
|
Here is the flow:
| <pageflow-definition name="payment-flow">
|
| <start-page name="authenticate" view-id="/authenticate.jspx">
| <redirect/>
| <transition to="authenticate">
| </transition>
| <transition name="doAuthenticate" to="confirm">
| <action expression="#{paymentAction.doAuthenticate}"/>
| </transition>
| </start-page>
|
| <page name="confirm" view-id="/confirm.jspx">
| <redirect/>
| <transition name="doConfirm" to="transact">
| <action expression="#{paymentAction.doConfirm}"/>
| </transition>
| </page>
|
| <decision name="transact" expression="#{true}">
| <transition name="true" to="acknowledge">
| <action expression="#{paymentAction.doTransact}"/>
| </transition>
| </decision>
|
| <page name="acknowledge" view-id="/acknowledge.jspx">
| <redirect/>
| <end-conversation/>
| </page>
|
| </pageflow-definition>
|
And finally the first page:
| <?xml version="1.0"?>
| <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns="http://www.w3.org/1999/xhtml"
| version="2.0">
| <jsp:output doctype-root-element="html"
| doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
| doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
| <jsp:directive.page contentType="text/html"/>
| <head>
| <title>Authenticate...</title>
| </head>
| <body>
| <h1>Authenticate...</h1>
| <f:view>
| <h:form>
| <h:messages globalOnly="true"/>
| <h:outputText value="Enter Account Number:"/>
| <h:inputText value="#{payment.accountNumber}" id="accountNumber" required="true">
| </h:inputText>
| <s:validateAll/>
| <h:commandButton value="Ok" action="doAuthenticate"/>
| <br/>
| </h:form>
| </f:view>
| </body>
| </jsp:root>
|
|
I see this in the log file but the flow continues to the next page. How can I make it stay on the first page?
2007-01-23 09:23:31,296 DEBUG [org.jboss.seam.interceptors.ValidationInterceptor] invalid value: accountNumber length must be between 10 and 12
2007-01-23 09:23:31,296 DEBUG [org.jboss.seam.interceptors.ValidationInterceptor] invalid value: accountNumber Must be alphanumeric.
Thanks in advance,
Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005328#4005328
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005328
19 years, 3 months
[Beginners Corner] - Retrieving EJB Reference - Best practice
by sickboy79
Hi.
I have problems connecting to my successful deployed EJB3 SessionBeans from within a web application. If I try it with a standalone J2SE Client App everything works fine.
If I do the following I get a ClassCastException in my Web Application, in the J2SE Client App this works fine.
Context context = new javax.naming.InitialContext();
| Object ref = context.lookup("myApp/MyRemoteBean/remote");
| MyRemoteInterface dm = (MyRemoteInterface)ref;
What am I doing wrong? Btw. What is the best practice to connect to an EJB3 Bean from a WebApp? Is there a way to obtain a reference through dependency injection?
Here my setup:
myApp.ear
| -> myejbs.jar (in here are my SessionBeans)
| -> myWebapp.war
My application.xml:
<application>
| <display-name>my_ejb</display-name>
| <module>
| <ejb>myejbs.jar</ejb>
| </module>
| <module>
| <web>
| <web-uri>myWebapp.war</web-uri>
| <context-root>/myWebApp</context-root>
| </web>
| </module>
| </application>
Thanks in advance
Tobias
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005317#4005317
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005317
19 years, 3 months