Intra-EAR classloading problem
by Nebojsa Bozovic
Hi,
I have an EAR application containing a connector RAR and EJB3 JAR. My
connector contains some classes which implement Serializable. Everything
worked fine until I tried to put an instance of such a class in an
ObjectMessage and then into a JMS queue from my EJB3 code, but now I get
ClassCastExceptions when trying to get the instance back out.
It seems that when the instance is deserialized and I try to cast it to
the original type, the class literal of the type I am trying to cast it
to and the runtime class of ObjectMessage.getObject() are loaded by
different ClassLoaders, which I can confirm simply by printing them out.
One of them has a URL pointing to the deployed EAR; the other has a null
URL.
I've tried defining a loader-repository for my EAR and using the class
preload service, but neither had any effect on the problem. I've tried
listing the types in question out in the loader-repository MBean using
the JMX console, but only one InstanceN/CodeSource ever appears.
The problem seems not to manifest itself after a fresh start of the
server. I can only get CCEs after I re-publish the EAR from Eclipse.
What can be done?
18 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - JPA differences from JBoss 4.04 to 4.2.1?
by fkchang
HI All:
We upgraded from 4.0.4 to 4.2.1 and a waar with JPA/Hibernate/MySQL which used to work fine on both 4.0.4 and the current GlassFish no longer works on 4.2.1
Here's a segment from the JBoss log
22:20:02,490 INFO [STDOUT] 22:20:02,490 INFO [QueryBinder] Binding Named query: ComplianceAgreements.findAllComplianceAgreementId => SELECT s FROM ComplianceAgreements s order by id desc
| 22:20:02,522 INFO [STDOUT] 22:20:02,522 INFO [EntityBinder] Bind entity com.baesystems.irad.hibernate.ComplianceAgreements on table compliance_agreements
| 22:20:02,580 INFO [STDOUT] 22:20:02,580 INFO [Version] Hibernate Validator 3.0.0.GA
| 22:20:02,691 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| java.lang.ClassCastException: org.hibernate.search.event.FullTextIndexEventListener
| at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:856)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
| at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
I suspect this may have something to do with jar version differences. I originally had ejb jars, which I removed, which had given me different stack traces, but I haven't been able to consistently duplicate them.
Is there a quick thing I'm missing?
THanks
Forrest
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082293#4082293
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082293
18 years, 7 months
[JBoss Seam] - Seam Integration Test
by nayanj
I am using Seam 1.2.1 and trying to write an integration test for my code. The pages run fine when deployed on server. However, when I run my testcase, I get following exception:
FAILED: testUpdate
javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'profileaction'
at com.sun.el.lang.ELSupport.throwUnhandled(ELSupport.java:52)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:75)
at com.sun.el.parser.AstValue.getTarget(AstValue.java:67)
at com.sun.el.parser.AstValue.setValue(AstValue.java:147)
at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:258)
at org.jboss.seam.util.UnifiedELValueBinding.setValue(UnifiedELValueBinding.java:44)
at org.jboss.seam.mock.SeamTest$Request.setValue(SeamTest.java:374)
at us.crimnet.iss.profile.test.ProfileActionTest$3.invokeApplication(ProfileActionTest.java:63)
at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:489)
at us.crimnet.iss.profile.test.ProfileActionTest.testUpdate(ProfileActionTest.java:74)
... Removed 22 stack frames
Obviously, there is something wrong with my test code but I cannot figure it out. Documentation seems to be very sparse on this topic.
My code is something like following:
public void testUpdate() throws Exception {
new FacesRequest() {
@Override
protected void invokeApplication() throws Exception {
// identity.login invoked from here
// along the lines of booking example..
// btw, what is a FacesRequest() with no parameters for ?
}
}.run();
new FacesRequest("/main.xhtml") {
// doing nothing here right now.
}.run();
new FacesRequest("/mypage.xhtml") {
@Override
protected void invokeApplication() throws Exception {
User user = (User) Contexts.getSessionContext().get("user"); // has Session scope
assert user.getGivenName().equals("Given");
assert user.getLastName().equals("Last");
MyBean bean = new MyBean(); // has Conversation Scope
Contexts.getConversationContext().set("bean",bean);
bean.setValue("value");
MyAction action = new MyAction(); // has EVENT Scope
Contexts.getEventContext().set("myaction",action);
setValue("#{myaction.user}",user); // Exception at this line!!
setValue("#{myaction.bean}",bean);
// have to call myaction.update method and then test how values of user and bean change..
}
}
}
please help...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082288#4082288
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082288
18 years, 7 months