[JBoss Remoting Development] - Remoting 2 bug: No reuse of ClientInvoker with params invokerDestructionDelay and socketFactoryClassName
by Patrick Speer
Patrick Speer [http://community.jboss.org/people/qliphot] created the discussion
"Remoting 2 bug: No reuse of ClientInvoker with params invokerDestructionDelay and socketFactoryClassName"
To view the discussion, visit: http://community.jboss.org/message/552308#552308
--------------------------------------------------------------
Hello,
I think I found a bug in InvokerRegistry.createClientInvoker(InvokerLocator locator, Map configuration) which leads to superflous instances of ClientInvoker (and therefore no reusing of an existing one).
I'm using JBoss AS 4.2.2.GA with JBoss Remoting 2.2.3-SP2. My ClientInvoker is configured via params with the following options:
<attribute name="socketFactoryClassName" isParam="true">package.of.MySSLSocketFactory</attribute>
<attribute name="invokerDestructionDelay" isParam="true">30000</attribute>
I was wondering why my application opened up new sockets for every remote call. The problem is, that for every call a new ClientInvoker is created and no reusing takes place:
In class InvokerRegistry.createClientInvoker line "ClientInvoker invoker = getRegisteredClientInvoker(locator, configuration);" checks for a suitable Invoker. If none is found, a new invoker is created and via "addRegisteredClientInvoker(invoker, l, configuration);" added to the holderList of the clientLocator. The problem is, that e.g. the constructor of RemoteClientInvoker modifies the configuration map. Then this modified map is passed to addRegisteredClientInvoker. But this map is used to identifiy the specific invoker in getRegisteredClientInvoker => so getRegisteredClientInvoker will never return an existing invoker.
Attached is a patch which fixes this problem. This all sounds a little bit confused, but I'm sure, if you have a look at the attached patch, you will understand my problem.
Regards,
Patrick
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/552308#552308]
Start a new discussion in JBoss Remoting Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 9 months
[jBPM] - Command service txn management
by M M
M M [http://community.jboss.org/people/gubespam] created the discussion
"Command service txn management"
To view the discussion, visit: http://community.jboss.org/message/552223#552223
--------------------------------------------------------------
In the default jbpm JTA configuration (jbpm.tx.jta.cfg.xml), the command service is set up three different ways (see below). Can someone say how jbpm which one to pick in each case? Looking at the code, it seems like jbpm should always pick the "newTxRequiredCommandService".
<command-service name="txRequiredCommandService"> <skip-interceptor /> <environment-interceptor /> <retry-interceptor type="jta" /> <jta-transaction-interceptor /> </command-service>
<command-service name="newTxRequiredCommandService"> <environment-interceptor policy="requiresNew" /> <retry-interceptor type="jta" /> <jta-transaction-interceptor policy="requiresNew" /> </command-service>
<command-service> <environment-interceptor /> </command-service>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/552223#552223]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 9 months
[jBPM] - Integrate with Web Application
by jDev Dev
jDev Dev [http://community.jboss.org/people/dSalam] created the discussion
"Integrate with Web Application"
To view the discussion, visit: http://community.jboss.org/message/552214#552214
--------------------------------------------------------------
Hi
I have developed a process definition in JBPM (3.2.3) and it is functioning properly.
I would like to integrate it as part of my web application but I am having some issues. I created my interface using only JSF (faces pages, face-config that includes navigation rules and managed beans). Every time I run my jsp page it gives an error at the following line
"*jbpmContext.deployProcessDefinition(processDefinition);*" in the code below
> public void execute() throws Exception
> {
> ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("TimerProcess/Tprocessdefinition.xml");
> JbpmContext jbpmContext= JbpmConfiguration.getInstance().createJbpmContext();
>
> System.out.println("------ parsing");
>
> try{
> // Create an instance of the process definition.
> ProcessInstance instance = processDefinition.createProcessInstance();
> System.out.println("------------ deploying process");
> jbpmContext.deployProcessDefinition(processDefinition);
> instance.signal("trSetTimer");
> JobExecutor jobExecutor = jbpmContext.getJbpmConfiguration().getJobExecutor();
>
>
> if (jobExecutor==null) {
> throw new JbpmException("no job executor configured in resource ");
> }
> jobExecutor.start();
>
> jbpmContext.save(instance);
> }finally{
> jbpmContext.close();
> }
> }
>
the error is
> [12/07/10 16:01:16:015 EDT] 00000026 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: Faces Servlet. Exception thrown : javax.servlet.ServletException: Exception while invoking expression #{scheduleMgrBean.init}
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:154)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
> at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
> at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
> at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
> at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
> at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
> at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
> at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
> at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
> ---- Begin backtrace for Nested Throwables
> javax.faces.el.EvaluationException: Exception while invoking expression #{scheduleMgrBean.init}
> at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
> at javax.faces.component.UICommand.broadcast(UICommand.java:89)
> at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
> at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
> at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
> at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
> at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
> at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
> at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
> at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
> at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
> at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
> at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
> Caused by: java.lang.NoClassDefFoundError: javax.jcr.RepositoryException
> at java.lang.J9VMInternals.verifyImpl(Native Method)
> at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
> at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
> at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:22)
> at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
> at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
> at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:118)
> at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
> at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
> at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
> at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
> at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
> at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:345)
> at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
> at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
> at ca.gc.hc.sc.cpirs.ScheduleMgr.execute(ScheduleMgr.java:35)
> at ca.gc.hc.sc.cpirs.ScheduleMgr.init(ScheduleMgr.java:18)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
> ... 25 more
>
> [12/07/10 16:01:16:156 EDT] 00000026 WebApp E [Servlet Error]-[Faces Servlet]: javax.faces.el.EvaluationException: Exception while invoking expression #{scheduleMgrBean.init}
> at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
> at javax.faces.component.UICommand.broadcast(UICommand.java:89)
> at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
> at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
> at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
> at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
> at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
> at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
> at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
> at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
> at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
> at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
> at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
> at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
> Caused by: java.lang.NoClassDefFoundError: javax.jcr.RepositoryException
> at java.lang.J9VMInternals.verifyImpl(Native Method)
> at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
> at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
> at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:22)
> at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
> at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
> at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:118)
> at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
> at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
> at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
> at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
> at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
> at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:345)
> at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
> at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
> at ca.gc.hc.sc.cpirs.ScheduleMgr.execute(ScheduleMgr.java:35)
> at ca.gc.hc.sc.cpirs.ScheduleMgr.init(ScheduleMgr.java:18)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
> ... 25 more
*Any assistance is appreciated. Am I missing any servlets or classes?*
my servlets are as follows
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Servlet Mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>GDP Deployer Servlet</servlet-name>
<servlet-class>org.jbpm.web.ProcessUploadServlet</servlet-class>
<load-on-startup>-1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>GDP Deployer Servlet</servlet-name>
<url-pattern>/upload/*</url-pattern>
</servlet-mapping>
I am simply using JSF and JBPM only. I moved all my hibernate.cfg and jbpm.confg and processdefinition.xml files into my class path. I also included the jbpm library and jbpm.jpdl and jbpm-identity jar files in my lib folder. *Am I missing anything else?*
thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/552214#552214]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 9 months