在ejb查找期间,Glassfish 3独立客户端挂起

时间:2013-03-26 20:30:16

标签: java java-ee-6 glassfish-3

根据本指南http://docs.oracle.com/cd/E18930_01/html/821-2418/gkusn.html#gkusp我试图从远程独立客户端访问ejb组件。执行我的远程客户端时,我在类路径上有gf-client.jar,并包含了jvm属性

-Dorg.omg.CORBA.ORBInitialHost=<remoteHost>
-Dorg.omg.CORBA.ORBInitialPort=3700

但是,当我的代码执行bean的查找时,它会挂起,不会抛出任何异常。在运行Glassfish的远程计算机上,我可以执行netstat并查看从客户端计算机到端口3700的已建立连接。有关如何解决此问题的任何想法吗?

编辑: 不知道吞下异常的地方,但是我能够在我的IDE中运行它,并且我在查找时抛出了这个异常,之后客户端挂起。

org.jvnet.hk2.component.ComponentException: injection failed on org.glassfish.api.invocation.InvocationManagerImpl.invHandlers with class [Lorg.glassfish.api.invocation.ComponentInvocationHandler;
    at org.jvnet.hk2.component.InjectionManager.error_injectionException(InjectionManager.java:284)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:161)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:93)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
    at org.jvnet.hk2.component.Habitat.getByContract(Habitat.java:1050)
    at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:779)
    at com.sun.enterprise.iiop.security.SecurityMechanismSelector.postConstruct(SecurityMechanismSelector.java:166)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
    at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1056)
    at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1037)
    at com.sun.hk2.component.InjectInjectionResolver.getComponentInjectValue(InjectInjectionResolver.java:159)
    at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:90)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:143)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:93)
    at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
    at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
    at org.jvnet.hk2.component.Habitat.getBy(Habitat.java:1056)
    at org.jvnet.hk2.component.Habitat.getByType(Habitat.java:1037)
    at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:781)
    at com.sun.enterprise.iiop.security.Lookups._getSecurityContextUtil(Lookups.java:97)
    at com.sun.enterprise.iiop.security.Lookups.getSecurityContextUtil(Lookups.java:92)
    at com.sun.enterprise.iiop.security.SecClientRequestInterceptor.<init>(SecClientRequestInterceptor.java:119)
    at com.sun.enterprise.security.appclient.AppclientIIOPInterceptorFactory.getClientInterceptorInstance(AppclientIIOPInterceptorFactory.java:127)
    at com.sun.enterprise.security.appclient.AppclientIIOPInterceptorFactory.createClientRequestInterceptor(AppclientIIOPInterceptorFactory.java:96)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBInitializer.post_init(GlassFishORBInitializer.java:132)
    at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.postInitORBInitializers(PIHandlerImpl.java:915)
    at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.initialize(PIHandlerImpl.java:265)
    at com.sun.corba.ee.impl.orb.ORBImpl.postInit(ORBImpl.java:643)
    at com.sun.corba.ee.impl.orb.ORBImpl.set_parameters(ORBImpl.java:704)
    at com.sun.corba.ee.impl.orb.ORBImpl.setParameters(ORBImpl.java:691)
    at com.sun.corba.ee.spi.osgi.ORBFactory.initialize(ORBFactory.java:107)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.initORB(GlassFishORBManager.java:581)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.getORB(GlassFishORBManager.java:263)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBFactoryImpl.createORB(GlassFishORBFactoryImpl.java:93)
    at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:152)
    at com.sun.enterprise.naming.impl.SerialContext.getORB(SerialContext.java:364)
    at com.sun.enterprise.naming.impl.SerialContext.getProviderCacheKey(SerialContext.java:371)
    at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:401)
    at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:346)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:504)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
    at com.sun.enterprise.naming.impl.SerialContext.listBindings(SerialContext.java:866)
    at javax.naming.InitialContext.listBindings(InitialContext.java:466)
    at com.apihotels.docrepo.test.DocUploaderTest.setup(DocUploaderTest.java:68)
    at com.apihotels.docrepo.test.DocUploaderTest.junitTestSetup(DocUploaderTest.java:54)
    at com.apihotels.docrepo.test.DocUploaderTest.main(DocUploaderTest.java:43)
Caused by: org.jvnet.hk2.component.ComponentException: Failed to create class com.sun.enterprise.resource.pool.PoolManagerImpl
    at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:71)
    at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:80)
    at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
    at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
    at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
    at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:703)
    at java.util.AbstractList$Itr.next(AbstractList.java:358)
    at java.util.AbstractCollection.toArray(AbstractCollection.java:188)
    at com.sun.hk2.component.InjectInjectionResolver.getArrayInjectValue(InjectInjectionResolver.java:113)
    at com.sun.hk2.component.InjectInjectionResolver.getValue(InjectInjectionResolver.java:81)
    at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:143)
    ... 58 more
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
    at java.lang.Class.getConstructor0(Class.java:2714)
    at java.lang.Class.newInstance0(Class.java:343)
    at java.lang.Class.newInstance(Class.java:325)
    at com.sun.hk2.component.ConstructorCreator.create(ConstructorCreator.java:65)
    ... 68 more

编辑2:

我正在尝试访问的远程接口。

@Remote
public interface TheRemoteInterface {
   public void method1();
}


@Stateless
public class TheImpl implements TheRemoteInterface {
   // no members
   @Override
   public void method1() {
   }
}

0 个答案:

没有答案