Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Urgent please

  Asked By: Conrad    Date: Jun 04    Category: Java    Views: 2038
  

i'm working with ejb3 framework and i encounter to an exception

my problem is here when i want to send an object (Entity) object or any Object from client (Java Client Application (Swing)) to my server (my web application is glassfish)
the system shows me this exception


Oct 17, 2008 11:06:42 AM com.sun.corba.ee.impl.io.FVDCodeBaseImpl implementation
WARNING: "IOP01000001: (NO_IMPLEMENT) Missing local value implementation"
org.omg.CORBA.NO_IMPLEMENT: vmcid: OMG minor code: 1 completed: Maybe
at com.sun.corba.ee.impl.logging.OMGSystemException.missingLocalValueImpl(OMGSystemException.java:2769)
at com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:118)
at com.sun.org.omg.SendingContext._CodeBaseImplBase._invoke(_CodeBaseImplBase.java:64)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: java.lang.ClassNotFoundException: ebankclient.persistobj.bank.Customer (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:202)
at com.sun.corba.ee.impl.util.JDKBridge.loadClass(JDKBridge.java:99)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.loadClass(Util.java:683)
at com.sun.corba.ee.impl.util.RepositoryId.getClassFromType(RepositoryId.java:568)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.getClassFromType(ValueHandlerImpl.java:433)
at com.sun.corba.ee.impl.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:112)
... 11 more


I added piece of code upon my codes to solve this problem

System.setSecurityManager(new RMISecurityManager());

but another exception was appeared

Oct 17, 2008 11:15:12 AM com.sun.corba.ee.impl.util.Utility loadStub
WARNING: "IOP01211405: (BAD_OPERATION) Exception in loadStub"
org.omg.CORBA.BAD_OPERATION: vmcid: SUN minor code: 1405 completed: No
at com.sun.corba.ee.impl.logging.UtilSystemException.exceptionInLoadStub(UtilSystemException.java:179)
at com.sun.corba.ee.impl.logging.UtilSystemException.exceptionInLoadStub(UtilSystemException.java:197)
at com.sun.corba.ee.impl.util.Utility.loadStub(Utility.java:856)
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:248)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:135)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:220)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:160)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at ebankclient.business.ejb.EJBFacade.save(EJBFacade.java:65)
at ebankclient.bankview.OpenAccountFrame$1.actionPerformed(OpenAccountFrame.java:316)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.security.AccessControlException: access denied (com.sun.corba.ee.impl.presentation.rmi.DynamicAccessPermission access)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.<init>(StubInvocationHandlerImpl.java:105)
at com.sun.corba.ee.impl.presentation.rmi.bcel.StubFactoryBCELImpl.makeStub(StubFactoryBCELImpl.java:171)
at com.sun.corba.ee.impl.util.Utility.loadStub(Utility.java:852)
... 34 more


but when i want to send a String or Integer object to may server my program works without any problem.

public void save(Object obj) {
try {
// System.setSecurityManager(new RMISecurityManager());
this.customerBankBusinessRemote = (CustomerBankBusinessRemote)
this.ctx.lookup("ebankejb.server.business.stateless.bank." +
"CustomerBankBusinessRemote");
this.customerBankBusinessRemote.saveCustomer(obj);
//System.out.println("ASDFADSFASDFASDFASDFASDFAsd");

/* Object ob = ctx.lookup("ebankejb.server.business.stateless.bank.CustomerBankBusinessRemote");
customerBankBusinessRemote = (CustomerBankBusinessRemote) PortableRemoteObject.narrow(ob,CustomerBankBusinessRemote.class);
customerBankBusinessRemote.saveCustomer(obj);
this.customerBankBusinessRemote.saveCustomer(obj);*/
} catch(Exception e) {
javax.swing.JOptionPane.showMessageDialog(null, e);
}
}

is there anybody there can tell me how can i solve this problem ?

Share: 

 

7 Answers Found

 
Answer #1    Answered By: Corbin Jones     Answered On: Jun 04

the first exception complains that you have no local interface for your Session Bean.

WARNING: "IOP01000001: (NO_IMPLEMENT) Missing local value implementation"

please give us more information:
- the Session Bean you have written
- the client  code to connect to the server
- the ORB settings in your Glassfish server, (you have to set ORB listener with correct port and IP)

 
Answer #2    Answered By: Taylor Evans     Answered On: Jun 04

The Session Bean i have written is here

import javax.ejb.Stateless;



/**
*
* @author root
*/
@Stateless
public class CustomerBankBusinessBean implements CustomerBankBusinessRemote {

// @PersistenceUnit(name="bank_server")
// private EntityManagerFactory emf;
// private EntityManager entity;

public void saveCustomer(Object obj) throws Exception {
try {
System.out.print("<========================>");
//entity = emf.createEntityManager();
//entity.getTransaction().begin();
//entity.persist(obj);
//entity.getTransaction().commit();
} catch(Exception e) {
javax.swing.JOptionPane.showMessageDialog(null,e);
throw e;
} finally {
//entity.clear();
}
}

}


/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package ebankejb.server.business.stateless.bank;

import javax.ejb.Remote;

/**
*
* @author root
*/
@Remote
public interface CustomerBankBusinessRemote {
public void saveCustomer(Object obj) throws Exception;
}


-------------------------------------------------------

The client  code to connect the server

public void save(Object obj) {
try {
System.setSecurityManager(new RMISecurityManager());
sun.corba.BridgePermission b= new BridgePermission("tes");
this.customerBankBusinessRemote = (CustomerBankBusinessRemote)
this.ctx.lookup("ebankejb.server.business.stateless.bank." +
"CustomerBankBusinessRemote");
ebankclient.persistobj.bank.Customer c = new Customer();
c.setName("afadsf");
this.customerBankBusinessRemote.saveCustomer(c);
//System.out.println("ASDFADSFASDFASDFASDFASDFAsd");

/* object  ob = ctx.lookup("ebankejb.server.business.stateless.bank.CustomerBankBusinessRemote");
customerBankBusinessRemote = (CustomerBankBusinessRemote) PortableRemoteObject.narrow(ob,CustomerBankBusinessRemote.class);
customerBankBusinessRemote.saveCustomer(obj);
this.customerBankBusinessRemote.saveCustomer(obj);*/
} catch(Exception e) {
javax.swing.JOptionPane.showMessageDialog(null, e);
}
}

----------------------------------------------------------
ORB setting in my glassfish
private Properties getEJBProperties() {
if (this.prop == null) {
this.prop = new Properties();
prop.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
prop.setProperty("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
prop.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
this.prop.setProperty("org.omg.CORBA.ORBInitialHost","localhost");
this.prop.setProperty("org.omg.CORBA.ORBInitialPort","34169");

}
return this.prop;
}


my port listener is 34169 i've set it by my self.

As told you if i want to send  a primitive variable like String or int my program works good.
But when i want to send an object the exception is appeared.
i dont have local interface because i dont need local business why do i create a local business?
Is it nesscery or not to have a local business!?

 
Answer #3    Answered By: Benjamin Simpson     Answered On: Jun 04

ok so as I can see you're connecting to local server, why not set a
Local interface as well?? maybe it works.
another issue is that as you told you have problem  with objects, Are
those objects serializabe?
my guess is maybe your object  has not marked with Serializable so the
RMI looking for a Local interface because it can't serialize your
object.

 
Answer #4    Answered By: Adalwen Fischer     Answered On: Jun 04

I want to send  an entity object  and of course this object implements Serializable interface. finally i encountered to another exception. what is your idea about this exception

Registering ad hoc servlet: WebPathPath: context root = "/ebank-app-client", path = "'
Java web  Start services started for stand-alone app client  com.sun.enterprise.appclient.jws.AppclientContentOrigin@18db76b registration name=ebank-app-client, context root=/ebank-app-client, module name=
"IOP00810257: (MARSHAL) Could not load class ebankclient.persistobj.bank.Customer"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9684)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:9699)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1042)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:896)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:466)
at com.sun.corba.ee.impl.corba.TCUtility.unmarshalIn(TCUtility.java:296)
at com.sun.corba.ee.impl.corba.AnyImpl.read_value(AnyImpl.java:610)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:748)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_any(CDRInputStream.java:406)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.readAny(Util.java:504)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$10.read(DynamicMethodMarshallerImpl.java:286)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readArguments(DynamicMethodMarshallerImpl.java:435)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:152)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)


 
Answer #5    Answered By: Dylan Evans     Answered On: Jun 04

I think It's happen when 2 different jar file version of one class load in class
loader and RMI cannot found the correct class.
check your jars version in lib folder under server  and client  application.
It's about your jars not security in RMI

 
Answer #6    Answered By: Kerry Wright     Answered On: Jun 04

I'm using netbeans 6.1 IDE for creating my project.
All jar files are imported, netbeans has accepted thair responsibility :D.
But maybe you right. i'm ganna check the jar files. but i dont thik my problem  will be solved.

 
Answer #7    Answered By: Miriam Green     Answered On: Jun 04

I'm using netbeans 6.1 IDE for creating my project.
All jar files are imported, netbeans has accepted thair responsibility :D.
But maybe you right. i'm ganna check the jar files. but i dont thik my problem  will be solved.

 
Didn't find what you were looking for? Find more on Urgent please Or get search suggestion and latest updates.




Tagged: