我想访问部署在TomEE服务器中的远程或本地EJB。
我的客户端程序也部署在同一个程序中。但当我查找并将其作为界面投射时,它会抛出ClassCastException
。
是否有任何微粒EJB路径可供查找?
我在TomEE服务器中的本地/远程EJB jar日志:
May 15, 2015 9:35:34 PM org.apache.openejb.config.ConfigurationFactory configureApplication
INFO: Configuring enterprise application: C:\Users\Sudhir\Desktop\apacheEjb\apache-tomee-webprofile-1.7.1\webapps\remoteejb.jar
May 15, 2015 9:35:34 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Auto-deploying ejb UuidSrvcImpl: EjbDeployment(deployment-id=UuidSrvcImpl)
May 15, 2015 9:35:34 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application "C:\Users\Sudhir\Desktop\apacheEjb\apache-tomee-webprofile-1.7.1\webapps\remoteejb.jar" loaded.
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Assembling app: C:\Users\Sudhir\Desktop\apacheEjb\apache-tomee-webprofile-1.7.1\webapps\remoteejb.jar
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=UuidSrvcImplLocal) --> Ejb(deployment-id=UuidSrvcImpl)
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/remoteejb/UuidSrvcImpl!com.service.uuidgen.UuidSrvc) --> Ejb(deployment-id=UuidSrvcImpl)
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/remoteejb/UuidSrvcImpl) --> Ejb(deployment-id=UuidSrvcImpl)
May 15, 2015 9:35:34 PM org.apache.openejb.cdi.CdiBuilder initSingleton
INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@5a8fddea
May 15, 2015 9:35:34 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container is starting...
May 15, 2015 9:35:34 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
May 15, 2015 9:35:34 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
May 15, 2015 9:35:34 PM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
INFO: All injection points were validated successfully.
May 15, 2015 9:35:34 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container has started, it took 16 ms.
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=UuidSrvcImpl, ejb-name=UuidSrvcImpl, container=Default Stateless Container)
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=UuidSrvcImpl, ejb-name=UuidSrvcImpl, container=Default Stateless Container)
May 15, 2015 9:35:34 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=C:\Users\Sudhir\Desktop\apacheEjb\apache-tomee-webprofile-1.7.1\webapps\remoteejb.jar)
May 15, 2015 9:37:24 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive C:\Users\Sudhir\Desktop\apacheEjb\apache-tomee-webprofile-1.7.1\webapps\ejb-examples-1.1.1-SNAPSHOT.war
May 15, 2015 9:37:24 PM org.apache.tomee.catalina.TomcatWebAppBuilde`enter code here`r init
我的客户端程序是:
properties.setProperty("openejb.embedded.remotable", "false");
properties.setProperty("openejb.validation.output.level ", "medium");
properties.put("java.naming.factory.initial ", "org.apache.openejb.client.LocalInitialContextFactory");
InitialContext initialContext = new InitialContext(properties);
(UuidSrvc)initialContext.lookup("java:global/remoteejb/UuidSrvcImpl"); (Here I get error)