[JBoss jBPM] - Get Instance
by magnumff
hi
I have developed a Java client application to external web service :
| Properties props = new Properties();
| props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
| props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
| InitialContext ctx = new InitialContext(props);
| RemoteCommandServiceHome commandServiceHome = (RemoteCommandServiceHome) ctx.lookup("ejb/CommandServiceBean");
| RemoteCommandService commandService =commandServiceHome.create();
|
can create an instance of the process xxxx. With the command :
commandService.execute(new NewProcessInstanceCommand("xxxx"));
I can not predict application process created. With the command :
Object o=commandService.execute( new GetProcessInstanceCommand(17));
error is :
Exception : java.lang.reflect.UndeclaredThrowableException
Cause : java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection; local class incompatible: stream classdesc serialVersionUID = 7602608801868099635, local class serialVersionUID = -5723701046347946317
StackTrace : [Ljava.lang.StackTraceElement;@9c82f4
Message : null
java.lang.reflect.UndeclaredThrowableException
at $Proxy1.execute(Unknown Source)
at ProvaClient.main(ProvaClient.java:40)
Caused by: java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection; local class incompatible: stream classdesc serialVersionUID = 7602608801868099635, local class serialVersionUID = -5723701046347946317
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:134)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:331)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:194)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
... 2 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176776#4176776
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176776
17 years, 10 months
[Clustering/JBoss] - Custom InvokerInterceptor
by bdinnerv
Hi All,
After much reading up, it appears that I need to write a custom InvokerInterceptor to achieve clustering of Session beans in JBoss (I am running on 4.2.3) and I have a couple of questions before I venture down this road (although it is not a lot of code when looking at it)
I have an application that runs entirely in the container, I no external client, the system is implemented in Sessions beans, Entity Beans, JMX MBeans and MDB Beans (it also has a minimal web client built on tapestry 5 for mainly management and configuration tasks), all in EJB3, and is a fairly highly stressed system which has become cpu bound, hence we are looking at gaining a performance increase by clustering.
As the application is fully contained within the container, we have the scenario where clients and session beans run in the same JVM (MDB's and JMX beans act as clients as well as session beans dependent on other session beans) so I predict a large performance increase by being able to load balance our session bean calls between multiple servers, however the limitation of the "optimization" where by the InvokerInterceptor routes calls to local instances only is a big limiting factor and does not allow us to distribute the load, hence looking at implementing a custom InvokerInterceptor.
1. When overriding hasLocalTarget and simply returning false, will the round robin process still send some requests to the "local" session bean instance as well as the "remote" instances in the cluster, or will it send ALL requests to the remote instances / nodes for processing and ignore the local instance all together?
2. If the answer to 1 is "Yes, it will send all requests to remote nodes" under the scenario of simply returning false, is the InvokerInterceptor "statefull". What i mean by this is would something like the following work:
| public class CustomInvokerInterceptor extends InvokerInterceptor {
|
| private boolean _local = false;
|
| public boolean hasLocalTarget() {
| if (_local) {
| _local = false;
| return true;
| } else {
| _local = true;
| return false;
| }
| }
| }
|
such that between calls to hasLocalTarget, the state of _local will be maintained, or will the be a fresh instantiation between invocations and thus always return false? If this is not the case and all calls end up going remote, we would essentially have an under utilised node on the cluster that simply acts as a client to the other nodes (I hate wasted resources :) )
3. Based on the fact that there are a number of threads regarding this issue over some time now, is it still an issue? IE, in 4.2.3 or even 5, do we still need to implement a custom InvokerInterceptor to "de-optimize" JBoss so we can optimize out application, or has it now been made configurable such that we can change a config setting to tell the container that we want a certain behavior or some other way to achieve RoundRobin load balancing? I understand the fact that it is more resource intensive to route a call to a remote node when it could be serviced locally, but that rule doesn't cater very well for the scenario where the local node is 100% CPU stressed and an application has become CPU bound.
Cheers,
Ben
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176772#4176772
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176772
17 years, 10 months
[JNDI/Naming/Network] - Re: Application name not bound?
by gla-001
In the global Namespace in the JNDI-View there is the following shown:
anonymous wrote :
| +- xyz (class: org.jnp.interfaces.NamingContext)
| | +- AbstractSessionBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
| | +- SearchManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
| | +- OrderManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
| | +- OISManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
| | +- UserManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
| | +- WebObjManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
| | +- ConfigurationManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy105 implements interface com.dept101.server.configurationMgr.interfaces.ConfigurationManagerLocal,interface org.jboss.ejb3.proxy.JBossProxy)
| | | +- remote (proxy: $Proxy104 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.configurationMgr.interfaces.ConfigurationManagerRemote)
| | +- AssistManagerBean (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy109 implements interface org.jboss.ejb3.proxy.JBossProxy,interface com.dept101.server.base.AbstractSessionDefinition)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176770#4176770
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176770
17 years, 10 months
[JNDI/Naming/Network] - Application name not bound?
by gla-001
Hello everybody,
i've got a problem i don't really understand. The applications name is xyz. While deploying the EJBs the following is logged:
anonymous wrote :
| 13:48:38,333 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=xyz.ear,jar=xyz-ejb-beans.jar,name=ConfigurationManagerBean,service=EJB3
| 13:48:38,334 INFO [JBossASKernel] with dependencies:
| 13:48:38,353 INFO [JBossASKernel] and demands:
| 13:48:38,353 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
| 13:48:38,354 INFO [JBossASKernel] and supplies:
| 13:48:38,354 INFO [JBossASKernel] jndi:xyz/ConfigurationManagerBean/local
| 13:48:38,354 INFO [JBossASKernel] Class:com.dept101.server.configurationMgr.interfaces.ConfigurationManagerRemote
| 13:48:38,354 INFO [JBossASKernel] jndi:xyz/ConfigurationManagerBean/local-com.dept101.server.configurationMgr.interfaces.ConfigurationManagerLocal
| 13:48:38,354 INFO [JBossASKernel] jndi:ConfigurationManagerBean
| 13:48:38,354 INFO [JBossASKernel] Class:com.dept101.server.configurationMgr.interfaces.ConfigurationManagerLocal
| 13:48:38,354 INFO [JBossASKernel] jndi:xyz/ConfigurationManagerBean/remote
| 13:48:38,354 INFO [JBossASKernel] jndi:xyz/ConfigurationManagerBean/remote-com.dept101.server.configurationMgr.interfaces.ConfigurationManagerRemote
| 13:48:38,354 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=xyz.ear,jar=xyz-ejb-beans.jar,name=ConfigurationManagerBean,service=EJB3) to KernelDeployment of: xyz-ejb-beans.jar
|
A client class looks up like this:
| ConfigurationManagerRemote configurationManagerRemote = (ConfigurationManagerRemote) ctx.lookup("xyz/ConfigurationManagerBean/remote");
|
When the client class is deployed, the following exception is thrown:
anonymous wrote :
| javax.naming.NameNotFoundException: xyz not bound
| at mypackage.GlobalDataEJB.getCO(GlobalDataEJB.java:189)
| at mypackage.SupressClientsideCachingFilter.init(SupressClientsideCachingFilter.java:74)
| at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:234)
| at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:332)
| at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:90)
| at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3735)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4376)
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:346)
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:139)
| at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:431)
| at org.jboss.web.deployers.WebModule.startModule(WebModule.java:112)
| at org.jboss.web.deployers.WebModule.start(WebModule.java:90)
| 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:616)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
| at $Proxy35.start(Unknown Source)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:271)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:624)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:442)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:88)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:46)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:991)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:257)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:135)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
| at org.jboss.Main.boot(Main.java:209)
| at org.jboss.Main$1.run(Main.java:544)
| at java.lang.Thread.run(Thread.java:636)
| Caused by: javax.naming.NameNotFoundException: ringfoto not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
| at javax.naming.InitialContext.lookup(InitialContext.java:409)
| at mypackage.GlobalDataEJB.getCO(GlobalDataEJB.java:185)
| ... 58 more
|
|
The funny thing is, that the application is deployed in jboss 5.0.0.Beta4, but in jboss 5.0.0.CR1 it doesn't work! Could anybody help?
Thanks!
GLA
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176762#4176762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176762
17 years, 10 months