users@glassfish.java.net

Exception when calling a java global jndi naming

From: <forums_at_java.net>
Date: Wed, 23 Nov 2011 12:12:03 -0600 (CST)

Hi,
I have a JEE 6 Oracle StoredFunctionCall method implemented in an EJB [1]
3.1, all deployed
in GF 3.1.1
When I try to call the EJB from an Application Client Project within an ear
project I get the following
exception,
javax.naming.CommunicationException [2]: Communication exception for
SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl}
[Root exception is java.rmi.RemoteException [3]: CORBA NO_IMPLEMENT
1398079489 Maybe; nested exception is:
org.omg.CORBA.NO_IMPLEMENT: ----------BEGIN server-side stack trace----------
org.omg.CORBA.NO_IMPLEMENT: ADVERTENCIA: IOP01000001: Missing local value
implementation vmcid: SUN minor code: 1 completed: Maybe
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:513)
at
com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at
com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at
com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy148.missingLocalValueImpl(Unknown Source)
at
com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:113)
at
com.sun.org.omg.SendingContext._CodeBaseImplBase._invoke(_CodeBaseImplBase.java:99)
at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:528)
at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:199)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at
com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.lang.ClassNotFoundException [4]:
session.__EJB31_Generated__ObtenerMaxIdPedidoUsuario__Intf____Bean__ (no
security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:202)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:135)
at com.sun.corba.ee.impl.util.JDKBridge.loadClassM(JDKBridge.java:319)
at com.sun.corba.ee.impl.util.JDKBridge.loadClass(JDKBridge.java:228)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.loadClass(Util.java:640)
at
com.sun.corba.ee.impl.util.RepositoryId.getClassFromType(RepositoryId.java:577)
at
com.sun.corba.ee.impl.io.ValueHandlerImpl.getClassFromType(ValueHandlerImpl.java:373)
at
com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:105)
... 12 more
----------END server-side stack trace---------- vmcid: SUN minor code: 1
completed: Maybe]
at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:542)
at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at Main.getMaxId(Main.java:34)
at Main.main(Main.java:17)
Caused by: java.rmi.RemoteException [5]: CORBA NO_IMPLEMENT 1398079489 Maybe;
nested exception is:
org.omg.CORBA.NO_IMPLEMENT: ----------BEGIN server-side stack trace----------
org.omg.CORBA.NO_IMPLEMENT: ADVERTENCIA: IOP01000001: Missing local value
implementation vmcid: SUN minor code: 1 completed: Maybe
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:513)
at
com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at
com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at
com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy148.missingLocalValueImpl(Unknown Source)
at
com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:113)
at
com.sun.org.omg.SendingContext._CodeBaseImplBase._invoke(_CodeBaseImplBase.java:99)
at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:528)
at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:199)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at
com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.lang.ClassNotFoundException [6]:
session.__EJB31_Generated__ObtenerMaxIdPedidoUsuario__Intf____Bean__ (no
security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:202)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:135)
at com.sun.corba.ee.impl.util.JDKBridge.loadClassM(JDKBridge.java:319)
at com.sun.corba.ee.impl.util.JDKBridge.loadClass(JDKBridge.java:228)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.loadClass(Util.java:640)
at
com.sun.corba.ee.impl.util.RepositoryId.getClassFromType(RepositoryId.java:577)
at
com.sun.corba.ee.impl.io.ValueHandlerImpl.getClassFromType(ValueHandlerImpl.java:373)
at
com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:105)
... 12 more
----------END server-side stack trace---------- vmcid: SUN minor code: 1
completed: Maybe
at
com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:311)
at
com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:213)
at
com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at
com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:227)
at
com.sun.enterprise.naming.impl._SerialContextProvider_DynamicStub.lookup(com/sun/enterprise/naming/impl/_SerialContextProvider_DynamicStub.java)
at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:505)
... 4 more
Caused by: org.omg.CORBA.NO_IMPLEMENT: ----------BEGIN server-side stack
trace----------
org.omg.CORBA.NO_IMPLEMENT: ADVERTENCIA: IOP01000001: Missing local value
implementation vmcid: SUN minor code: 1 completed: Maybe
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:513)
at
com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at
com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at
com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at
com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy148.missingLocalValueImpl(Unknown Source)
at
com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:113)
at
com.sun.org.omg.SendingContext._CodeBaseImplBase._invoke(_CodeBaseImplBase.java:99)
at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:528)
at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:199)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1486)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:990)
at
com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:214)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:742)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:539)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2324)
at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:497)
at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:540)
Caused by: java.lang.ClassNotFoundException [7]:
session.__EJB31_Generated__ObtenerMaxIdPedidoUsuario__Intf____Bean__ (no
security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:202)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:135)
at com.sun.corba.ee.impl.util.JDKBridge.loadClassM(JDKBridge.java:319)
at com.sun.corba.ee.impl.util.JDKBridge.loadClass(JDKBridge.java:228)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.loadClass(Util.java:640)
at
com.sun.corba.ee.impl.util.RepositoryId.getClassFromType(RepositoryId.java:577)
at
com.sun.corba.ee.impl.io.ValueHandlerImpl.getClassFromType(ValueHandlerImpl.java:373)
at
com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:105)
... 12 more
----------END server-side stack trace---------- vmcid: SUN minor code: 1
completed: Maybe
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:513)
at
com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:900)
at
com.sun.corba.ee.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:131)
at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:637)
at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:499)
at
com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:373)
at
com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:273)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at
com.sun.org.omg.SendingContext._CodeBaseStub.implementation(_CodeBaseStub.java:63)
at
com.sun.corba.ee.impl.encoding.CachedCodeBase.implementation(CachedCodeBase.java:119)
at
com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.getClassFromString(CDRInputStream_1_0.java:2292)
at
com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1095)
at
com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:935)
at
com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:525)
at com.sun.corba.ee.impl.corba.TCUtility.unmarshalIn(TCUtility.java:289)
at com.sun.corba.ee.impl.corba.AnyImpl.read_value(AnyImpl.java:605)
at
com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:775)
at
com.sun.corba.ee.impl.encoding.CDRInputObject.read_any(CDRInputObject.java:482)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.readAny(Util.java:452)
at
com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$10.read(DynamicMethodMarshallerImpl.java:299)
at
com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:483)El
MaxId es null
at
com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:203)
... 8 more
Here is the main method of the Application Client Project within an ear
project.
I took the java global JNDI naming from the GF log file,
public class Main {
   
    private ObtenerMaxIdPedidoUsuario obtenerMaxIdPedidoUsuario;
   
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Main myMain = new Main();
        try {
            System.out.println("El MaxId es " + myMain.getMaxId());
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    /* (non-Java-doc)
     * @see java.lang.Object#Object()
     */
    public Main() {
        super();
    }
   
    private String getMaxId() throws Exception{
        try{
            obtenerMaxIdPedidoUsuario = (ObtenerMaxIdPedidoUsuario)
new InitialContext().
              
 lookup("java:global/AlmacenEAR/AlmacenEJB/ObtenerMaxIdPedidoUsuario");
            return obtenerMaxIdPedidoUsuario.ObtenerMaxId();
        } catch(NamingException ex) {
            ex.printStackTrace();
        }
        return null;
    }
}
 
And here is the EJB,
@Stateless
public class ObtenerMaxIdPedidoUsuario implements java.io.Serializable {
    private static final long serialVersionUID = 1L;
   
    /**
     * Default constructor.
     */
    public ObtenerMaxIdPedidoUsuario() {
        // TODO Auto-generated constructor stub
    }
   
    public String ObtenerMaxId() throws Exception {
        final Logger logger =
Logger.getLogger("ObtenerMaxIdPedidoUsuario");
       
        EntityManagerFactory emf =
Persistence.createEntityManagerFactory("AlmacenJPA");
        EntityManager em = emf.createEntityManager();
       
        try {
       
            JpaEntityManager jpaEntityManager =
JpaHelper.getEntityManager(em);
            Session session = jpaEntityManager.getActiveSession();
            StoredFunctionCall call = new StoredFunctionCall();
            call.setProcedureName("ALMACEN.fn_Obtener_MaxId");
                       
            ValueReadQuery query = new ValueReadQuery();
            query.setCall(call);
           
            return (String) session.executeQuery(query);
           
        } catch (Exception ex) {
            logger.severe("ERROR: " + ex.getMessage());
            throw ex;
        }
    }
}
I know that the StoredFunctionCall musts return a Number value, but this is
just a test.
In my web app I have it returning a Long value, that is in fact what I need.
The problem
is that I get an exception about can't cast from java.lang.String [8] to
java.lang.Long [9].
I do not know what is happening so I need to know whitch is the String [10]
value for debuging.
Kind regards,
Jose


[1] http://www.coderanch.com/forums/f-11/EJB-JEE
[2]
http://download.oracle.com/javase/7/docs/api/javax/naming/CommunicationException.html
[3]
http://download.oracle.com/javase/7/docs/api/java/rmi/RemoteException.html
[4]
http://download.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html
[5]
http://download.oracle.com/javase/7/docs/api/java/rmi/RemoteException.html
[6]
http://download.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html
[7]
http://download.oracle.com/javase/7/docs/api/java/lang/ClassNotFoundException.html
[8] http://download.oracle.com/javase/7/docs/api/java/lang/String.html
[9] http://download.oracle.com/javase/7/docs/api/java/lang/Long.html
[10]
http://www.coderanch.com/t/410859/java/java/String-StringBuffer-StringBuilder-Performance

--
[Message sent by forum member 'josealvarezdelara']
View Post: http://forums.java.net/node/867538