Re: [xfire-user] XFire , Aegis and Hibernate (org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Text)

2007-09-13 Thread Connor Sadler


For anyone getting this error, here is a solution (which worked for me):

The error is something like:
org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Text:
org/jdom/Text

The confusing thing is that you DO have the jdom jar available in your
WEB-INF/lib.

The stack trace in my case mentions jaxen:
Caused by: java.lang.NoClassDefFoundError: org/jdom/Text
at org.jaxen.jdom.JDOMXPath.init(JDOMXPath.java:100)
at org.jdom.xpath.JaxenXPath.setXPath(JaxenXPath.java:281)
at org.jdom.xpath.JaxenXPath.init(JaxenXPath.java:99)


The issue is that the jaxen jar is missing from your webapp but is
available to JBoss (in my case) in a classloader higher up the tree, looking
at jboss/lib. This directory does NOT contain jdom, and this classloader
cannot load jdom from your webapp as it cannot see your WEB-INF/lib.
The solution is to ensure the jaxen jar supplied with XFire is in your
WEB-INF/lib - in my case this is jaxen-1.1-beta-9.jar

HTH,

Connor






Rathinaganesh Meenakshisundaram wrote:
 

 Greetings:

 I am using XFire, EJB and Hibernate.

 I am accessing this ejb from a web service project...

 In the ejb project...
 I have an EJB bean class named RegistrarEr.java.
 Also, I've an Hibernate dataobject named RegistrationEr.java too..
 This data object has another data object like the following in it..
 
 This is a hibernate generated data object.
 
   public class ChallengeQuestion extends AbstractChallengeQuestion
 implements java.io.Serializable {
 
   }
 
 public abstract class AbstractRegistrationEr implements
 java.io.Serializable{

 private ChallengeQuestion challengeQuestion;

 }

 I am creating a binding file for this dataobject , using
 RegistrationEr.aegis.xml as follows
 
 
 
RegistrationEr.aegis.xml
 
 mappings
   mapping
   property name=challengeQuestion componentType=
 com.vrs.selfserv.hibernate.dataobject.ChallengeQuestion /
   method name=getChallengeQuestion
   return-type componentType=
 com.vrs.selfserv.hibernate.dataobject.ChallengeQuestion /
   /method
   method name=setChallengeQuestion
   return-type componentType=
 com.vrs.selfserv.hibernate.dataobject.ChallengeQuestion /
   /method
   /mapping
 /mappings
 
 
  This is my services.xml
 beans xmlns=http://xfire.codehaus.org/config/1.0;
 
 service
 nameRegistrarService/name
 serviceClass
 com.vrs.selfserv.session.interfaces.RegistrarService
 /serviceClass
 implementationClass
 com.vrs.selfserv.session.ejb.Registrar
 /implementationClass
 stylerpc/style
 useliteral/use
 scopeapplication/scope
 /service
 service
 nameRegistrarErService/name
 namespacehttp:///namespace
 serviceClass
 com.vrs.selfserv.session.interfaces.RegistrarErService
 /serviceClass
 implementationClass
 com.vrs.selfserv.session.ejb.RegistrarEr
 /implementationClass
 stylerpc/style
 useliteral/use
 scopeapplication/scope
 /service
 /beans
 
 
 When I start the server after deploying it, Iam getting the following
 error..
 Any Idea..??
 
 
 
 
 ERROR [XFireServlet] Error initializing XFireServlet.

 org.springframework.beans.factory.BeanCreationException: Error creating
 bean
 with name 'org.codehaus.xfire.spring.ServiceBean#1' defined in class path
 resource [META-INF/xfire/services.xml]: Initialization of bean failed;
 nested exception is org.codehaus.xfire.XFireRuntimeException: Error
 evaluating xpath /mappings/[EMAIL PROTECTED]'
 http://interfaces.session.selfserv.vrs.com'http://interfaces.session.selfserv.vrs.com%27/].
 Nested exception is
 org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Text:
 org/jdom/Text

 org.codehaus.xfire.XFireRuntimeException: Error evaluating xpath
 /mappings/[EMAIL 
 PROTECTED]'http://interfaces.session.selfserv.vrs.com'http://interfaces.session.selfserv.vrs.com%27/].
 Nested
 exception is org.jdom.JDOMException: java.lang.NoClassDefFoundError :
 org/jdom/Text: org/jdom/Text

 org.jdom.JDOMException: java.lang.NoClassDefFoundError: org/jdom/Text:
 org/jdom/Text




 If I remove the RegistrationEr.aegis.xml file, the server starts up
 without
 any error..But, throws the following error, when I try to access the
 WSDL...

 org.codehaus.xfire.XFireRuntimeException: Couldn't create type for
 property
 challengeQuestion on class
 com.vrs.selfserv.hibernate.dataobject.RegistrationEr : Error evaluating
 xpath
 /mappings/[EMAIL 
 PROTECTED]'http://interfaces.session.selfserv.vrs.com'http://interfaces.session.selfserv.vrs.com%27/
 ].
 Nested exception is org.jdom.JDOMException:
 java.lang.NoClassDefFoundError:
 org/jdom/Text: org/jdom/Text
 
 
Also, I've the jdom.jar in the webservice project classpath...
I tried adding the jdom.jar to the EJB project classpath..But, still it
 did not work..!
 
 
 
 Thanks,
 -Ganesh.

 
 

-- 
View this message 

Re: [xfire-user] Using the bindings yourself

2007-02-27 Thread Connor Sadler


Hi,

I'm fairly new to XFire but have done some hacking through the source code
myself.
I would do this:

1. (optional) Follow the XFire tutorials (or MyEclipse tutorials) to expose
a bean with a method using a custom type POJO as a web service. Get this
working with a client
[If you already have your client+server working then maybe you dont need to
do this]

2. Put the application server into debug mode, and put a breakpoint in
AegisBindingProvider.readParameter. Note: You'll  need the XFire source for
this debugging. This is where it uses the parameter type to deserialize from
the incoming XML.

You can see how the Type objects serialize and deserialize to/from XML. Then
hopefully you can recreate this in other scenarios.

Good luck,

Connor


-- 
View this message in context: 
http://www.nabble.com/Using-the-bindings-yourself-tf3301741.html#a9185504
Sent from the XFire - User mailing list archive at Nabble.com.


-
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email