users@glassfish.java.net

Re: [Fwd: Remote EJB injection problem]

From: Willem Viljoen <willemnviljoen_at_gmail.com>
Date: Mon, 28 Feb 2011 11:44:44 +0200

Hi Cheng,

Thanks for the reply. I've tried setting the JNDI name in sun-ejb-jar.xml as
you suggested, and changed the sun-web.xml on the other host accordingly,
but the same behavior persists. The behavior is the same on GlassFish 3.0.1
and GlassFish 3.1 (promoted build 43)

I also discussed it with Arun Gupta on Twitter on Friday and he suggested I
file a bug report. Unfortunately I can't currently register to get access
because of the Java.net move, so I'm probably stuck for the next few days.

I've created a completely bare-bones simple test app to reproduce the
problem, just to make sure that it isn't something else in our code causing
it. The behavior remains the same. Unfortunately I can't attach the source
to this message as planned, because GMail seems to think that java sources
are executable files.

I find this line of log output particularly worrying:

Caused by: org.omg.CORBA.BAD_PARAM: FINE: IOP00100009: string_to_object
conversion failed due to bad schema specific part in name
ejb/AveBean__3_x_Internal_RemoteBusinessHome__ vmcid: SUN minor code: 9
 completed: No

This seems similar to the bug reported here:
http://java.net/jira/browse/GLASSFISH-14704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

That bug was supposed to be fixed in 3.1 milestone 8, I am using promoted
build 43, which I understand was long after milestone 8. Also, the bug
listed there seems to only affect application servers with the security
manager turned on, I have confirmed that the security manager is off on both
my application servers.

I'll attempt to report this as a bug as soon as I can get in to Java.net
again.

Willem

On Fri, Feb 25, 2011 at 8:23 PM, Cheng Fang <cheng.fang_at_oracle.com> wrote:

> Hi Willem,
>
> Your app looks good to me. Can you try it on the latest GlassFish version,
> 3.1?
>
> Next, can you try using the GlassFish-specific global JNDI name for
> PersonFacade EJB on server 1?
>
> Add a META-INF/sun-ejb-jar.xml to EJB.jar on server 1:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application
> Server 9.0 EJB 3.0//EN" "
> http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
> <sun-ejb-jar>
> <enterprise-beans>
> <ejb>
> <ejb-name>PersonFacade</ejb-name>
> <jndi-name>ejb/PersonFacade-host1</jndi-name>
> </ejb>
> </enterprise-beans>
> </sun-ejb-jar>
>
> Change sun-web.xml on server 2:
>
> <ejb-ref>
> <ejb-ref-name>ejb/PersonFacade</ejb-ref-name>
> <jndi-name>corbaname:iiop:
> willem-laptop.int.spacialdev.com:3700#ejb/PersonFacade-host1</jndi-name>
> </ejb-ref>
>
> -cheng
>
>> -------- Original Message --------
>> Subject: Remote EJB injection problem
>> Date: Thu, 24 Feb 2011 16:00:31 +0200
>> From: Willem Viljoen <willemnviljoen_at_gmail.com>
>> Reply-To: users_at_glassfish.java.net
>> To: users_at_glassfish.java.net
>>
>>
>>
>> Hi,
>>
>> I'm having trouble trying to remotely inject an EJB from another app
>> server instance. I'm using the portable JNDI name as described in the
>> GlassFish FAQ, and when I inject the bean from localhost, it works, but not
>> when I inject from another host. Here is a brief description of my
>> environment:
>>
>> --- On application server 1: (willem-laptop.int.spacialdev.com <
>> http://willem-laptop.int.spacialdev.com>, GlassFish 3.0.1) ---
>>
>> /*
>> * PersonFacade.java
>> * inside EJB.jar
>> * which is inside Logic.ear
>> */
>>
>> @Stateless
>> public class PersonFacade extends EntityFacade<Person> implements
>> PersonFacadeLocal, PersonFacadeRemote {
>> // ...
>> }
>>
>> --
>>
>> /*
>> * Logic.ear/classlibrary.jar/PersonFacadeRemote.java
>> */
>>
>> @Remote
>> public interface PersonFacadeRemote {
>> // ...
>> }
>>
>> -- From the server log, I have this portable JNDI name for the bean --
>>
>> java:global/Logic/EJB/PersonFacade!com.spacial.common.remote.PersonFacadeRemote
>>
>>
>> -- On application server 2: (willem-desktop.int.spacialdev.com <
>> http://willem-desktop.int.spacialdev.com>, GlassFish 3.0.1) --
>>
>> /*
>> * User.java
>> * inside Website.war
>> */
>>
>> @ManagedBean(name = "user")
>> @ViewScoped
>> public class User extends AbstractManagedBean implements Serializable {
>> // ..
>>
>> @EJB(name="ejb/PersonFacade")
>> private PersonFacadeRemote personFacade;
>>
>> // ..
>> }
>>
>> -- PersonFacadeRemote.java is available to the WAR through the included
>> class library --
>>
>> -- In sun-web.xml --
>>
>> <ejb-ref>
>> <ejb-ref-name>ejb/PersonFacade</ejb-ref-name>
>> <jndi-name>corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade!com.spacial.common.remote.PersonFacadeRemote<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade%21com.spacial.common.remote.PersonFacadeRemote></jndi-name>
>>
>> </ejb-ref>
>>
>> --
>>
>> The WAR deploys without problems, but as soon as I try to access a page
>> that user the User managed bean, the following exception gets thrown:
>>
>> WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service()
>> for servlet Faces Servlet threw exception
>> com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred
>> performing resource injection on managed bean user
>> at
>> com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:211)
>> at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:103)
>> at
>> com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:405)
>> at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:267)
>> at
>> com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86)
>> at
>> javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
>> at
>> com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
>> at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:99)
>> at com.sun.el.parser.AstValue.getValue(AstValue.java:158)
>> at
>> com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
>> at
>> org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:71)
>> at
>> com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:102)
>> at
>> javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
>> at
>> javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
>> at javax.faces.component.UIOutput.getValue(UIOutput.java:168)
>> at
>> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
>> at
>> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:338)
>> at
>> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
>> at
>> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
>> at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
>> at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
>> at
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
>> at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
>> at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
>> at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
>> at
>> com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
>> at
>> com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
>> at
>> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
>> at
>> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
>> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
>> at
>> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
>> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
>> at
>> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
>> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
>> at
>> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
>> at
>> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
>> at
>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
>> at
>> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
>> at
>> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
>> at
>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
>> at
>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
>> at
>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>> at
>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
>> at
>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>> at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
>> at
>> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
>> at
>> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
>> at java.lang.Thread.run(Thread.java:662)
>> Caused by: com.sun.faces.spi.InjectionProviderException:
>> com.sun.enterprise.container.common.spi.util.InjectionException: Exception
>> attempting to inject Remote ejb-ref name=ejb/PersonFacade,Remote 3.x
>> interface
>> =com.spacial.common.remote.PersonFacadeRemote,ejb-link=null,lookup=null,mappedName=,jndi-name=corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade!com.spacial.common.remote.PersonFacadeRemote,refType=Session<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade%21com.spacial.common.remote.PersonFacadeRemote,refType=Session>
>> into class com.spacialaudio.spacialmedia.web.User
>> at
>> org.glassfish.faces.integration.GlassFishInjectionProvider.inject(GlassFishInjectionProvider.java:98)
>> at
>> com.sun.faces.mgbean.BeanBuilder.injectResources(BeanBuilder.java:205)
>> ... 55 more
>> Caused by:
>> com.sun.enterprise.container.common.spi.util.InjectionException: Exception
>> attempting to inject Remote ejb-ref name=ejb/PersonFacade,Remote 3.x
>> interface
>> =com.spacial.common.remote.PersonFacadeRemote,ejb-link=null,lookup=null,mappedName=,jndi-name=corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade!com.spacial.common.remote.PersonFacadeRemote,refType=Session<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade%21com.spacial.common.remote.PersonFacadeRemote,refType=Session>
>> into class com.spacialaudio.spacialmedia.web.User
>> at
>> com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:614)
>> at
>> com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:384)
>> at
>> com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:168)
>> at
>> org.glassfish.faces.integration.GlassFishInjectionProvider.inject(GlassFishInjectionProvider.java:94)
>> ... 56 more
>> Caused by: javax.naming.NamingException: Lookup failed for
>> 'java:comp/env/ejb/PersonFacade' in SerialContext [Root exception is
>> javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref
>> name=ejb/PersonFacade,Remote 3.x interface
>> =com.spacial.common.remote.PersonFacadeRemote,ejb-link=null,lookup=null,mappedName=,jndi-name=corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade!com.spacial.common.remote.PersonFacadeRemote,refType=Session<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade%21com.spacial.common.remote.PersonFacadeRemote,refType=Session>'
>> . Actual (possibly internal) Remote JNDI name used for lookup is
>> 'corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade__3_x_Internal_RemoteBusinessHome__<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade__3_x_Internal_RemoteBusinessHome__>'
>> [Root exception is org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 9
>> completed: No]]
>> at
>> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
>> at javax.naming.InitialContext.lookup(InitialContext.java:392)
>> at
>> com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:513)
>> ... 59 more
>> Caused by: javax.naming.NamingException: Exception resolving Ejb for
>> 'Remote ejb-ref name=ejb/PersonFacade,Remote 3.x interface
>> =com.spacial.common.remote.PersonFacadeRemote,ejb-link=null,lookup=null,mappedName=,jndi-name=corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade!com.spacial.common.remote.PersonFacadeRemote,refType=Session<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade%21com.spacial.common.remote.PersonFacadeRemote,refType=Session>'
>> . Actual (possibly internal) Remote JNDI name used for lookup is
>> 'corbaname:iiop:
>> willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade__3_x_Internal_RemoteBusinessHome__<
>> http://willem-laptop.int.spacialdev.com:3700#java:global/Logic/EJB/PersonFacade__3_x_Internal_RemoteBusinessHome__>'
>> [Root exception is org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 9
>> completed: No]
>> at
>> com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:174)
>> at
>> com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1040)
>> at
>> com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:688)
>> at
>> com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:657)
>> at
>> com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:148)
>> at
>> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:428)
>> ... 61 more
>> Caused by: org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 9 completed:
>> No
>> at
>> com.sun.corba.ee.impl.logging.OMGSystemException.soBadSchemaSpecific(OMGSystemException.java:1075)
>> at
>> com.sun.corba.ee.impl.logging.OMGSystemException.soBadSchemaSpecific(OMGSystemException.java:1093)
>> at
>> com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:228)
>> at
>> com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:154)
>> at
>> com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:144)
>> at
>> com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:954)
>> at
>> com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:167)
>> ... 66 more
>> Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:
>> omg.org/CosNaming/NamingContext/NotFound:1.0 <
>> http://omg.org/CosNaming/NamingContext/NotFound:1.0>
>> at
>> org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
>> at
>> org.omg.CosNaming._NamingContextExtStub.resolve_str(_NamingContextExtStub.java:165)
>> at
>> com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:222)
>> ... 70 more
>>
>> --
>>
>> Has anyone encountered this problem? Please help.
>>
>> Thanks
>> Willem
>>
>