1 Reply Latest reply on Aug 31, 2004 3:09 AM by Jan Voskuil

    Inexplicable NoClassDefFoundError

    Jan Voskuil Newbie

      On JBoss-3.2.2 I deploy the eXist database (http://exist.sourceforge.net/) as an embedded application, using a sar-file. The service archive contains all libraries needed by the service implementation (such as exist.jar).

      From inside an EJB, I call methods on the service (which I look up through JNDI). The EJB sits inside an ear file, which also contains all necessary jars (including exist.jar). This works quite neatly. I can create and remove XML documents, and so on.

      However, when calling a particular method (xquery-related), I get a NoClassDefFoundError --- see the stacktrace below. What is really odd is that, as the stacktrace shows, the problem occurs inside a class that is called inside a class (etc...) that is part of the the exist code base and hence resides in exist.jar. When checking this, it appears that this same jar file in fact also contains the class file that JBoss cannot find.

      I have tried putting exist.jar in JBOSS_HOME/lib, in JBOSS_HOME/server/default/lib, and in the deploy directory itself, and leaving them out of the ear and/or sar files, although I may have missed one or two combinations. None of these strategies worked.

      Does anybody have ideas?


      java.lang.NoClassDefFoundError: org/exist/util/serializer/DOMStreamerPool
      at org.exist.memtree.NodeImpl.toSAX(NodeImpl.java:477)
      at org.exist.memtree.NodeImpl.copyTo(NodeImpl.java:487)
      at org.exist.xquery.EnclosedExpr.eval(EnclosedExpr.java:79)
      at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:39)
      at org.exist.xquery.PathExpr.eval(PathExpr.java:118)
      at org.exist.xquery.ElementConstructor.eval(ElementConstructor.java:107)
      at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:39)
      at org.exist.xquery.PathExpr.eval(PathExpr.java:118)
      at org.exist.xmldb.LocalXPathQueryService.doQuery(LocalXPathQueryService.java:240)
      at org.exist.xmldb.LocalXPathQueryService.execute(LocalXPathQueryService.java:154)
      at com.anachron.dbresearch.XdServerEJB.applyXQuery(XdServerEJB.java:85)
      at com.anachron.dbresearch.XdServerEJB.runTest(XdServerEJB.java:54)
      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:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta
      iner.java:683)