[Installation, Configuration & DEPLOYMENT] - Re: FileNotFoundException... (Access denied) Tuscany deploym
by drlzzt
Tried to deploy an exploded version it's the same just takes not from tmp folder but strait from deploy as it should but permission error is the same.
The dot is interesting but i don't have a clue how it's influenced by the application if there no such error in tomcat.
[STDERR] Sep 30, 2008 3:04:55 PM org.apache.tuscany.sca.host.webapp.WebAppServletHost initContextPath
INFO: ContextPath: /mdas-webapp-0.0.1-SNAPSHOT
15:04:58,697 ERROR [1-SNAPSHOT]] Exception starting filter tuscany
org.osoa.sca.ServiceRuntimeException: java.lang.reflect.InvocationTargetException
at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:276)
at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:83)
at org.apache.tuscany.sca.host.webapp.WebAppServletHost.init(WebAppServletHost.java:218)
at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.init(TuscanyServletFilter.java:52)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3722)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4367)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.start(Unknown Source)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
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:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy46.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
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:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
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:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:258)
... 141 more
Caused by: org.osoa.sca.ServiceRuntimeException: java.io.FileNotFoundException: C:\Java\jboss-4.2.2.GA\server\default\.\deploy\mdas-webapp-0.0.1-SNAPSHOT.war (Access is denied)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.addContribution(DefaultSCADomain.java:331)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:183)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.(DefaultSCADomain.java:120)
at org.apache.tuscany.sca.host.webapp.WebSCADomain.(WebSCADomain.java:41)
... 146 more
Caused by: java.io.FileNotFoundException: C:\Java\jboss-4.2.2.GA\server\default\.\deploy\mdas-webapp-0.0.1-SNAPSHOT.war (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)
at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:105)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl$2.run(ContributionServiceImpl.java:364)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl$2.run(ContributionServiceImpl.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:362)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain$3.run(DefaultSCADomain.java:326)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.addContribution(DefaultSCADomain.java:324)
... 149 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179549#4179549
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179549
15 years, 6 months
[EJB 3.0] - Multiple EJBs with same name in different jars - deployment
by jaikiran
I have an EAR file containing 2 ejb jar files. Each of the jar files has one EJB3.0 Stateless bean each:
MyApp.ear
| |
| |--- META-INF
| | |
| | |--- application.xml
| | |
| | |--- jboss-app.xml
| |
| |
| |--- appOneEjb.jar
| | |
| | |--- org/myapp/AppManagerBean.class
| |
| |
| |--- appTwoEjb.jar
| | |
| | |--- org/myapp/AppManagerBeanV2.class
| |
| |
| |--- common.jar
| | |
| | |--- org/myapp/AppManager.class
|
|
Both these stateless beans (AppManagerBeanV2.class and AppManagerBean.class) implement the same AppManager.class and more importantly the "name" attribute of the @Stateless annotation for both these beans is the same. However, these 2 beans are packaged in different jar files inside an EAR:
@Stateless (name="mybean")
| @Remote (AppManager.class)
| public class AppManagerBeanV2 implements AppManager {
|
| public String getVersion() {
| return "2.0";
| }
|
| }
|
@Stateless (name="mybean")
| @Remote (AppManager.class)
| public class AppManagerBean implements AppManager {
|
| public String getVersion() {
| return "1.0";
| }
|
| }
|
I could not find much documentation on the name attribute of @Stateless. But since the "name" is equivalent to the ejb-name in the ejb-jar.xml, i guess, the following (from the ejb-jar.xml dtd) holds true:
anonymous wrote : The ejb-name element specifies an enterprise bean's name. ... The name must be unique among the names of the enterprise beans in the same ejb-jar file.
|
So as per this definition, i guess i can have multiple EJBs with the same name, but in different jar files (as in my sample application). But when i deploy, this on JBoss-5 CR2 i get the following exception during deployment:
17:01:35,311 INFO [JBossASKernel] Created KernelDeployment for: another_ejb3.jar
| 17:01:35,311 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=ZEJB3Persistence.ear,jar=another_ejb3.jar,name=mybean,service=EJB3
| 17:01:35,311 INFO [JBossASKernel] with dependencies:
| 17:01:35,311 INFO [JBossASKernel] and demands:
| 17:01:35,311 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
| 17:01:35,311 INFO [JBossASKernel] and supplies:
| 17:01:35,311 INFO [JBossASKernel] jndi:AppManagerRemoteV2
| 17:01:35,311 INFO [JBossASKernel] Class:org.myapp.ejb.AppManager
| 17:01:35,311 INFO [JBossASKernel] jndi:ZEJB3Persistence/mybean/remote-org.myapp.ejb.AppManager
| 17:01:35,311 INFO [JBossASKernel] jndi:ZEJB3Persistence/mybean/remote
| 17:01:35,311 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=ZEJB3Persistence.ear,jar=another_ejb3.jar,name=mybean,service=EJB3) to KernelDeployment of: another_ejb3.jar
| 17:01:35,779 INFO [JBossASKernel] Created KernelDeployment for: myapp_ejb3.jar
| 17:01:35,795 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3
| 17:01:35,795 INFO [JBossASKernel] with dependencies:
| 17:01:35,795 INFO [JBossASKernel] and demands:
| 17:01:35,795 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
| 17:01:35,795 INFO [JBossASKernel] and supplies:
| 17:01:35,795 INFO [JBossASKernel] Class:org.myapp.ejb.AppManager
| 17:01:35,795 INFO [JBossASKernel] jndi:ZEJB3Persistence/mybean/remote-org.myapp.ejb.AppManager
| 17:01:35,795 INFO [JBossASKernel] jndi:AppManagerRemote
| 17:01:35,795 INFO [JBossASKernel] jndi:ZEJB3Persistence/mybean/remote
| 17:01:35,795 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3) to KernelDeployment of: myapp_ejb3.jar
| 17:01:35,795 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=UserManagerBean,service=EJB3
| 17:01:35,795 INFO [JBossASKernel] with dependencies:
| 17:01:35,795 INFO [JBossASKernel] and demands:
| 17:01:35,795 INFO [JBossASKernel] jboss.j2ee:ear=ZEJB3Persistence.ear,name=mybean,service=EJB3,*
| 17:01:35,795 INFO [JBossASKernel] persistence.unit:unitName=ZEJB3Persistence.ear/myapp_ejb3.jar#EJB3Persistence
| 17:01:35,795 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
| 17:01:35,795 INFO [JBossASKernel] and supplies:
| 17:01:35,795 INFO [JBossASKernel] Class:org.myapp.ejb.UserManagerRemote
| 17:01:35,795 INFO [JBossASKernel] jndi:ZEJB3Persistence/UserManagerBean/local-org.myapp.ejb.UserManagerLocal
| 17:01:35,795 INFO [JBossASKernel] Class:org.myapp.ejb.UserManagerLocal
| 17:01:35,795 INFO [JBossASKernel] jndi:ZEJB3Persistence/UserManagerBean/local
| 17:01:35,795 INFO [JBossASKernel] jndi:RemoteUserManagerBean
| 17:01:35,795 INFO [JBossASKernel] jndi:ZEJB3Persistence/UserManagerBean/remote-org.myapp.ejb.UserManagerRemote
| 17:01:35,795 INFO [JBossASKernel] jndi:testMappedNameJai
| 17:01:35,795 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=UserManagerBean,service=EJB3) to KernelDeployment of: myapp_ejb3.jar
| 17:01:37,186 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=ZEJB3Persistence.ear,jar=another_ejb3.jar,name=mybean,service=EJB3
| 17:01:37,201 INFO [EJBContainer] STARTED EJB: org.myapp.ejb.impl.AppManagerBeanV2 ejbName: mybean
| 17:01:37,217 WARN [SessionSpecContainer] Populating JBoss-specific annotation metadata manually until done by deployers: jboss.j2ee:ear=ZEJB3Persistence.ear,jar=another_ejb3.jar,name=mybean,service=EJB3
| 17:01:37,608 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3
| 17:01:37,608 INFO [EJBContainer] STARTED EJB: org.myapp.ejb.impl.AppManagerBean ejbName: mybean
| 17:01:37,608 WARN [SessionSpecContainer] Populating JBoss-specific annotation metadata manually until done by deployers: jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3
| 17:01:37,639 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3
| 17:01:37,639 INFO [EJBContainer] STOPPED EJB: org.myapp.ejb.impl.AppManagerBean ejbName: mybean
| 17:01:37,670 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3 state=Create
| java.lang.RuntimeException: Could not bind Reference Class Name: Proxy for: org.myapp.ejb.AppManager
| Type: ProxyFactoryKey
| Content: ProxyFactory/AppManagerRemote
| Type: EJB Container Name
| Content: jboss.j2ee:ear=ZEJB3Persistence.ear,jar=myapp_ejb3.jar,name=mybean,service=EJB3
| Type: Remote Business Interface
| Content: org.myapp.ejb.AppManager
| Type: Remoting Host URL
| Content: socket://ps3346:3873/?
| into JNDI at "ZEJB3Persistence/mybean/remote-org.myapp.ejb.AppManager"
| at org.jboss.ejb3.proxy.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:694)
| at org.jboss.ejb3.proxy.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:674)
| at org.jboss.ejb3.proxy.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:641)
| at org.jboss.ejb3.proxy.jndiregistrar.JndiSessionRegistrarBase.bindEjb(JndiSessionRegistrarBase.java:165)
| at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:706)
| at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:220)
| at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:858)
| 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.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
| at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
| at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
| at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
| at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
| 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.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
| 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:169)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1024)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1056)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
| 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:595)
| Caused by: javax.naming.NameAlreadyBoundException
| at org.jnp.server.NamingServer.bind(NamingServer.java:165)
| at org.jnp.server.NamingServer.bind(NamingServer.java:130)
| at org.jnp.server.NamingServer.bind(NamingServer.java:130)
| at org.jnp.interfaces.NamingContext.bind(NamingContext.java:593)
| at org.jnp.interfaces.NamingContext.bind(NamingContext.java:554)
| at org.jboss.util.naming.Util.bind(Util.java:105)
| at org.jboss.util.naming.Util.bind(Util.java:91)
| at org.jboss.ejb3.proxy.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:689)
| ... 55 more
|
|
Am i doing the right thing by having multiple beans with the same name? If yes, then it looks like when creating the jndi names for the interface specific proxies, we might even have to include the jar name in the jndi name to avoid this exception.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179545#4179545
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179545
15 years, 6 months
[EJB 3.0] - flushing EJB3 for use with EJB2.1
by robert.geisler
hello everybody,
i m confronted with a problem of simultaneous using of EJB2.1 and EJB3.0 in one server application and i hope to find some help here.
preface:
currently i m migrating a complex application implemented with EJB2.1 to EJB3.0. the application consists of several moduls (about 120) that are packaged as JARs in one EAR. every modul contains a few SLSBs and EntityBeans (different layers for access, logic and data).
my problem appears in the situation when the data layer of an EJB3.0 module and the data layer of an EJB2.1 module are involved in one process (one process means one transaction for one client interaction).
usecase:
a client starts a process on my server application by invoking a service of module "EJB3Module". in the first step of the process an Entity (EJB3.0) of type "EJB3Entity" is created and persisted. in the second step the primary key of this Entity (column "ID") is forwarded to the service of module "EJB21Module" that creates and persists an EntityBean (EJB2.1) of type "EJB21EntityBean". The EntityBean holds an reference to the Entity in column "EJB3Entity_ID", but the foreign key is only mapped by database and isnt mapped by JPA (EJB3.0) or CMP (EJB2.1).
problem:
the problem is, when the EntityBean of module "EJB3Module" gets persisted, an exception is thrown: "foreign key violation", because the value of column "EJB3Entity_ID" in table "EJB21EntityBean" is verified against column "ID" in table "EJB3Entity" and there is no such value.
i try to explain the reason of my problem. if i am wrong in some places, please let me know.
reason:
in my understanding, as the Entity is created by an EntityManager, it is registered in the persistence context, but not synchronized to database, because the transaction continues (JPA specification 3.2.3). later, when the EntityBean is being created CMP tries to write the EntityBean to database (because there is no persistence context in EJB2.1) and then database complains about foreign key, because the database doesnt know the Entity yet.
solution:
i successfully tried to explicitly flush the persistence context (EntityManager.flush()) to synchronize it to database after create, update and remove of an EJB3.0 Entity: the database then knows about the Entity and the EntityBean is created.
questions:* are my assumptions correct and is this the expected behaviour?
| * is there a way to set FlushModeType of EntityManager to something like always?
| * if not, i guess i have to call EntityManager.flush() after every JPA action until i finally migrated all EJBs from EJB2.1 to EJB3.0. right?
| * does it make sence to flush after every JPA action? or does it make even more sence to flush just before an EJB2.1 needs to read an EJB3.0 Entity?
i hope to have a discussion about my issue. please give me some input, hints and ideas, i m waiting for your answers.
regards
robert
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179539#4179539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179539
15 years, 6 months