Could not load class xxx

Hi everybody,

I just encountered a problem since some hours that really block me.

I use a glassfish server, and EJB(JPA/Toplink), and theses EJB are accessed only by session beans from 2 J2EE website.

I've a problem when I do the myFacade.create(myobject);(there is only a em.persist(myobject) into it, like the default of netbeans), I've an error:

"IOP00810257: (MARSHAL) Could not load class datamodel.Service"
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.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:690)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:359)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211)
        at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211)
        at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211)
        at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211)
        at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211)
        at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:368)
        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.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:183)
        at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:219)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:192)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
        at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
        at gateways.inputs.ejbcontainer.__DealFacadeRemote_Remote_DynamicStub.create(gateways/inputs/ejbcontainer/__DealFacadeRemote_Remote_DynamicStub.java)
        at gateways.inputs.ejbcontainer._DealFacadeRemote_Wrapper.create(gateways/inputs/ejbcontainer/_DealFacadeRemote_Wrapper.java)
        at trustbnsms.Index.addDeal(Index.java:167)
        at trustbnsms.Index.manageSMS(Index.java:127)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
        at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
        at javax.faces.component.UICommand.broadcast(UICommand.java:383)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
javax.ejb.EJBException: nested exception is: java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested exception is:
        org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace----------





....(there is a lot of repetitive things after.)




It's very strange because this class exist, I can access to others without any problem(I'm adding an object that have a foreign key to this object.

I'm really lost with what is the problem here. Thanks for your help
//Import in my request bean
import datamodel.Deal;
import datamodel.Service;
import datamodel.User;
 
 
 
//Here is the request bean's part code:
        //we add the deal
        Deal d = new Deal();
        d.setIdOfferedService(servfac.find(BRIDGE_LIST.get(idoffer)));//I've checked with debugger, we've a correct value in theses services
        d.setIdRequestedService(servfac.find(BRIDGE_LIST.get(idrequest)));
        d.setIdUser(usr);
        d.setInsertionDate(new Date(System.currentTimeMillis()));
        d.setStatus(Deal.STATUS_FREE);
        d.setDescription(tokens[2]);
        dealfac.create(d);
 
 
 
 
//the create method in my facade:
    public void create(Deal deal) {
        em.persist(deal);
    }
 
 
 
 
 
//Relations in my "deal" entity
    @Id    
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Lob
    @Column(name = "description")
    private String description;
    @Column(name = "status", nullable = false)
    private int status;
    @JoinColumn(name = "id_offered_service", referencedColumnName = "id")
    @ManyToOne
    private Service idOfferedService;
    @JoinColumn(name = "id_requested_service", referencedColumnName = "id")
    @ManyToOne
    private Service idRequestedService;
    @JoinColumn(name = "id_user", referencedColumnName = "id")
    @ManyToOne
    private User idUser;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idDealGive")
    private Collection<Match> matchCollectionGive;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idDealReceive")
    private Collection<Match> matchCollectionReceive;
    
    
    @Column(name = "date_inserted", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date insertionDate;
 
    
    @Column(name = "date_expiration", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date expirationDate;
 
 
 
 
//Relations in the Service class
    @Id    
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "name", nullable = false)
    private String name;
    @Lob
    @Column(name = "description")
    private String description;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idOfferedService")
    private Collection<Deal> dealCollection;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idRequestedService")
    private Collection<Deal> dealCollection1;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", fetch=FetchType.EAGER)
    private Collection<Service> serviceCollection;
    
    @JoinColumn(name = "parent", referencedColumnName = "id")
    @ManyToOne
    private Service parent;

Open in new window

LVL 1
NargzulAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
check that your classes are compiled with the same version (and not a later version) than the server is tunning
0
NargzulAuthor Commented:
I've "clean and build", and "undeploy and redeploy" the EJB container. I've do the same for my WAR. I've undeployed manually all EJB/WAR on the glassfish server, I've restarted it too, restarted Netbeans too.
0
a_bCommented:
This seems to be more of a config issue than a code level issue. Check whether you are referring to the correct jars/lib
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

NargzulAuthor Commented:
Where? In the EJB section?

The space thing is that I have retrieve some "service" in the same page, and I've check I've corrects values in theses. It's only when I create the object, and it's a remote error. Is that my Facade Bean doesn't know the Service class?
0
a_bCommented:
Since there is a problem with marshalling while tryimg to acces 'Service' so there is problem while identifying service.
0
NargzulAuthor Commented:
Yes, and? Which file can be erroneous?
0
a_bCommented:
You need to add the jar that contains that service and you need to lookup that service corectly.
0
a_bCommented:
Make sure that the class you are trying to access is in the classpath of the client.
0
NargzulAuthor Commented:
I'm not sure to understand:

If I can make FacadeService.find(id) and get a good service, it must be that my import of EJB works no?

I've deleted and re-imported the EJB project jar in my Enterprise website project, but it doesn't change anything.

I don't do any lookup, I use injection, and like I said, this works.

It's only when I'm in the method of my Facade, when the em.persist(); is done that I've this problem. If it crash with this method, the problem should be in the EJB project no?
0
NargzulAuthor Commented:
small precision, I do a em.persist(); of a Deal object, that have foreign key to two service
0
a_bCommented:
Like I said earlier, this is not a code level issue, more of a config issue.
0
NargzulAuthor Commented:
Oups I don't have saw your previous message.

But I don't ever understand, if the CLIENT cannot access, or don't know this class, he cannot make the previous "find", and will crash here!

And netbeans know this class and it compile, normaly if the client doesn't know a class the compilation will be aborted no?

I'm ok this can be a config issue, but I really think this config issue is on the EJB project, because the error happens when I'm already on the server side.

Where can I check theses classpath vars?
0
a_bCommented:
How are you deploying the bean? Is it in a jar file? If yes, then the jar needs to be in the client's lib directory.
0
NargzulAuthor Commented:
In facts, it's the ant script of netbeans that do everything.

I only do a "Undeploy and deploy" on the project(after having done a "Build"). And I've given the EJB jar in reference of the enterprise website.

But I think he is because before it crash, the program do many things with class present in the EJB package(check if a user exist, check some information about it, check if a service exist, check if a deal exist), all theses things works and I've correct informations into retrieved information.

If it's a client config issue like you are thinking, how is it possible that all theses things works?
0
a_bCommented:
What server are you using? Once you do a deploy check on the jndi tree whether service is visible there.
Also, is server an entity? If yes, then you cannot access an entity directly you have to go via a bean.
0
NargzulAuthor Commented:
"I use a glassfish server, and EJB(JPA/Toplink), and theses EJB are accessed only by session beans from 2 J2EE website."

Theses "sessions beans" are the Facade, having a remote interface.

Like I've said, the problem is when I do the em.persist in the facade bean, not on the client side.

Entities class would not be in the jndi tree because they are accessed by the facade, and facades are present in the jndi tree.
0
NargzulAuthor Commented:
Here is the screenshot of the glassfish admin panel
Capturer.JPG
0
NargzulAuthor Commented:
I've try an other thing: regenerate this entity from the database.

And it works! Now the problem is on the Deal class, I've try to do same, but:
-I've done a lot of modification on this generated class
-It doesn't change anything.

So it's maybe a configuration file generated by netbeans at the generation no? What generate netbean for configuration file?

Thanks for your help
0
NargzulAuthor Commented:
I've tried this:
http://timothyyip.org/jroller/blog/entry/remote_nightmare

But it doesn't change anything for me
0
a_bCommented:
Is the issue till persisting?
0
NargzulAuthor Commented:
yes :(
0
a_bCommented:
As per comment - 24862784, you said that the issue went away?
0
NargzulAuthor Commented:
The problem is the same but not on the same class.

It's always on the call.

I don't see any special anotation I've on one of theses class and haven't on an other.
0
NargzulAuthor Commented:
I've made some advances: I've try to remove all field concerning another of my classes, and it works(I got a SQL error, but it's normal, I assume that if I got SQL error, it's mean the marshalling has worked).

When I add the reference of services to the deal: no problem, I still got the SQL error.

But when I add the reference to the User, I've this error back!

I've try to create directly an User but I don't have any problem.
0
NargzulAuthor Commented:
I've found the problem, but I dont understand.

In the User, I've the deal collection.

If she is loaded by the Eagger type, it crash with this error. If I remove this annotation, it works.

Somebody has an explanation?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.