You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Jonathan J. Vargas R." <jo...@gmail.com> on 2005/08/05 07:48:28 UTC

Happyaxis reports problems loading libraries, found but with problems

Greets,

I tried to install xmlsec into axis, but seems axis has problems doing
this. The problem is with xmlsec, but I still don't know how to solve
it or fix it. I am using tomcat, This is the happyaxis report:


Optional Components


Warning: could not find a dependency of class
org.apache.xml.security.Init from file xmlsec.jar
XML Security is not supported
See http://xml.apache.org/security/
The root cause was: org/apache/xpath/compiler/FuncLoader
This can happen e.g. if org.apache.xml.security.Init is in the
'common' classpath, but a dependency like activation.jar is only in
the webapp classpath.

Found Java Secure Socket Extension (javax.net.ssl.SSLSocketFactory) at
an unknown location


-- 
Jonathan J. Vargas Rodriguez
jonathan.j.vargas@gmail.com
"Conservar el silencio interior cuando vuelo en la tormenta me es
mejor, porque asi ya no soy otra gota de la tempestad"

Re: Happyaxis reports problems loading libraries, found but with problems

Posted by Javier Gonzalez <ja...@gmail.com>.
On 8/5/05, Jonathan J. Vargas R. <jo...@gmail.com> wrote:
> To play the last chance, I tried placing activation.jar in
> <tomcat>/common/lib, and leaving xmlsec.jar first on shared/lib and
> later in webapps dir, as expected, they also didn't work.

It should work with both on <webapp>/WEB-INF/lib

> According to the code in happyaxis.jsp, when invoking its method
> needClass(String className) it is throwing NoClassDefFoundError
> exception. If it were unable to find the class, it will lauch a
> ClassNotFoundException (method classExists(String className) in
> happyaxis.jsp), right? It finds the class but it has a wrong class
> definition or doesn't exist (according with doc found about java api).

NoClassDefFoundError means "a class that was there on compile time
isn't there at runtime". For example, if you have a class A that
imports class B, and class B has a static initializer, and there's an
exception in said initializer, class B won't be loaded at all
(ExceptionInInitializerError). Then, if you try to use A you'll get a
NoClassDefFoundError because B isn't there and should be.

I tried with a clean axis install on tomcat 5.0.28. These are the jars
on the WEB-INF/lib directory of the webapp:

activation.jar
<my own app>.jar
axis-ant.jar
axis.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar
jaxrpc.jar
log4j-1.2.9.jar
saaj.jar
wsdl4j-1.5.1.jar
xmlsec-1.2.1.jar

Happyaxis says it's ok except for attachments since I didn't provide
mail.jar. Check your shared and common lib dirs for stale jars. 99% of
the time it's better to not have anything on those dirs. The only jar
I use outside the app's WEB-INF/lib dir is usually the jdbc driver so
that I can use the tomcat built-in connection pools. Everything else
goes in the webapp dir. A stale/mismatched version in common or shared
lib dirs can break your app.

-- 
Javier Gonzalez Nicolini

Re: Happyaxis reports problems loading libraries, found but with problems

Posted by "Jonathan J. Vargas R." <jo...@gmail.com>.
Hi, 

I tried with several combinations. I had xmlsec.jar and activation.jar
in the same folder, it was <tomcat>/shared/lib, and it caused the
problem I just told you.

Then, I though to move xmlsec.jar to the webapp lib directory and left
activation.jar into shared/lib, according with the classloader order I
understood from you. Then I restarted tomcat, refreshed happyaxis
page, and it told me the same problem.

So I decided to place both jars in the webapp directory, restarted and
reloaded page.. the same prob..

As last option, I left activation.jar in the webapp dir and xmlsec.jar
into <tomcat>/shared/lib, did the same restart process, and it was the
same problem.

To play the last chance, I tried placing activation.jar in
<tomcat>/common/lib, and leaving xmlsec.jar first on shared/lib and
later in webapps dir, as expected, they also didn't work.

According to the code in happyaxis.jsp, when invoking its method
needClass(String className) it is throwing NoClassDefFoundError
exception. If it were unable to find the class, it will lauch a
ClassNotFoundException (method classExists(String className) in
happyaxis.jsp), right? It finds the class but it has a wrong class
definition or doesn't exist (according with doc found about java api).

Is this a version incompatibility ?

What could I do then?


this is happyaxis dump:
-----------


Needed Components
Found SAAJ API (javax.xml.soap.SOAPMessage) at D:\Programas\Tomcat
5.5\webapps\axis\WEB-INF\lib\saaj.jar
Found JAX-RPC API (javax.xml.rpc.Service) at D:\Programas\Tomcat
5.5\webapps\axis\WEB-INF\lib\jaxrpc.jar
Found Apache-Axis (org.apache.axis.transport.http.AxisServlet) at
D:\Programas\Tomcat 5.5\webapps\axis\WEB-INF\lib\axis.jar
Found Jakarta-Commons Discovery
(org.apache.commons.discovery.Resource) at D:\Programas\Tomcat
5.5\webapps\axis\WEB-INF\lib\commons-discovery.jar
Found Jakarta-Commons Logging (org.apache.commons.logging.Log) at
D:\Programas\Tomcat%205.5\bin\commons-logging-api.jar
Found Log4j (org.apache.log4j.Layout) at D:\Programas\Tomcat
5.5\webapps\axis\WEB-INF\lib\log4j-1.2.8.jar
Found IBM's WSDL4Java (com.ibm.wsdl.factory.WSDLFactoryImpl) at
D:\Programas\Tomcat 5.5\webapps\axis\WEB-INF\lib\wsdl4j.jar
Found JAXP implementation (javax.xml.parsers.SAXParserFactory) at an
unknown location
Found Activation API (javax.activation.DataHandler) at
D:\Programas\Tomcat 5.5\shared\lib\activation.jar
Optional Components

Warning: could not find class javax.mail.internet.MimeMessage from file mail.jar
Attachments will not work
See http://java.sun.com/products/javamail/

Warning: could not find a dependency of class
org.apache.xml.security.Init from file xmlsec.jar
XML Security is not supported
See http://xml.apache.org/security/
The root cause was: org/apache/xpath/compiler/FuncLoader
This can happen e.g. if org.apache.xml.security.Init is in the
'common' classpath, but a dependency like activation.jar is only in
the webapp classpath.

Found Java Secure Socket Extension (javax.net.ssl.SSLSocketFactory) at
an unknown location
The core axis libraries are present. 2 optional axis libraries are missing

Examining Application Server
Servlet version	2.4
XML Parser	com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
XML ParserLocation	an unknown location

xamining System Properties

java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
sun.boot.library.path=D:\Programas\JRE 1.5\bin
java.vm.version=1.5.0_02-b09
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
path.separator=;
java.vm.name=Java HotSpot(TM) Client VM
tomcat.util.buf.StringCache.byte.enabled=true
file.encoding.pkg=sun.io
user.country=CR
sun.os.patch.level=Service Pack 2
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\WINDOWS\system32
java.runtime.version=1.5.0_02-b09
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=D:\Programas\Tomcat 5.5\common\endorsed
os.arch=x86
java.io.tmpdir=D:\Programas\Tomcat 5.5\temp
line.separator=

java.vm.specification.vendor=Sun Microsystems Inc.
user.variant=
java.util.logging.manager=org.apache.juli.ClassLoaderLogManager
java.naming.factory.url.pkgs=org.apache.naming
os.name=Windows XP
sun.jnu.encoding=Cp1252
java.library.path=D:\Programas\Tomcat
5.5\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Archivos de
programa\Windows Resource
Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Programas\MySQL
Server 4.1\bin
java.specification.name=Java Platform API Specification
java.class.version=49.0
sun.management.compiler=HotSpot Client Compiler
os.version=5.1
user.home=C:\
user.timezone=GMT-06:00
catalina.useNaming=true
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.specification.version=1.5
file.encoding=Cp1252
catalina.home=D:\Programas\Tomcat 5.5
user.name=SYSTEM
java.class.path=D:\Programas\Tomcat 5.5\bin\bootstrap.jar
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=D:\Programas\JRE 1.5
java.specification.vendor=Sun Microsystems Inc.
user.language=es
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode, sharing
java.version=1.5.0_02
java.ext.dirs=D:\Programas\JRE 1.5\lib\ext
sun.boot.class.path=D:\Programas\JRE 1.5\lib\rt.jar;D:\Programas\JRE
1.5\lib\i18n.jar;D:\Programas\JRE
1.5\lib\sunrsasign.jar;D:\Programas\JRE
1.5\lib\jsse.jar;D:\Programas\JRE 1.5\lib\jce.jar;D:\Programas\JRE
1.5\lib\charsets.jar;D:\Programas\JRE 1.5\classes
java.vendor=Sun Microsystems Inc.
server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar
catalina.base=D:\Programas\Tomcat 5.5
file.separator=\
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

Platform: Apache Tomcat/5.5.9



-- 
Jonathan J. Vargas Rodriguez
jonathan.j.vargas@gmail.com
"Conservar el silencio interior cuando vuelo en la tormenta me es
mejor, porque asi ya no soy otra gota de la tempestad"

Re: Happyaxis reports problems loading libraries, found but with problems

Posted by Javier Gonzalez <ja...@gmail.com>.
The first problem could be avoided by leaving xmlsec in the webapp lib dir. 

As for the second one... I do not know :(

On 8/5/05, Thad Humphries <th...@mindwrap.com> wrote:
> I have almost the problem as Jonathan.  I'm running Tomcat 5.5.9 with Java 1.5
> on Linux.  My message reads:
> 
> See http://xml.apache.org/security/ {4}
> The root cause was: org/apache/commons/logging/LogFactory
> 
> This happens whether I put xmlsec-1.2.1.jar in $CATALINA_HOME/common/lib or
> $CATALINA_HOME/common/endorsed.  When I put xmlsec-1.2.1.jar in
> $CATALINA_HOME/webapps/axis/WEB-INF/lib, the message was
> 
> See http://xml.apache.org/security/ {4}
> The root cause was: {0}
> 
> What does this mean?  Should I be using an older version of xmlsec-1.2.1.jar?
> 
> On Friday 05 August 2005 09:58, Javier Gonzalez wrote:
> > Where are xmlsec.jar and activation.jar located? (the hint that the
> > error message told you)
> >
> > IIRC, in Tomcat the classloaders are ordered like this: webapp ->
> > shared -> common -> system. The classloaders can look in that order
> > and not in the reverse order. That is, if A.jar is on the webapp lib
> > dir, B.jar is in shared/lib, and A depends on B, it's ok, since the
> > webapp classloader can ask the next classloader for B. But if B
> > depends on A, then you'll have an error because the shared classloader
> > can't look "back" into the webapp classloader.
> >
> > On 8/5/05, Jonathan J. Vargas R. <jo...@gmail.com> wrote:
> > > Greets,
> > >
> > > I tried to install xmlsec into axis, but seems axis has problems doing
> > > this. The problem is with xmlsec, but I still don't know how to solve
> > > it or fix it. I am using tomcat, This is the happyaxis report:
> > >
> > >
> > > Optional Components
> > >
> > >
> > > Warning: could not find a dependency of class
> > > org.apache.xml.security.Init from file xmlsec.jar
> > > XML Security is not supported
> > > See http://xml.apache.org/security/
> > > The root cause was: org/apache/xpath/compiler/FuncLoader
> > > This can happen e.g. if org.apache.xml.security.Init is in the
> > > 'common' classpath, but a dependency like activation.jar is only in
> > > the webapp classpath.
> > >
> > > Found Java Secure Socket Extension (javax.net.ssl.SSLSocketFactory) at
> > > an unknown location
> 


-- 
Javier Gonzalez Nicolini

Re: Happyaxis reports problems loading libraries, found but with problems

Posted by Thad Humphries <th...@mindwrap.com>.
I have almost the problem as Jonathan.  I'm running Tomcat 5.5.9 with Java 1.5 
on Linux.  My message reads:

See http://xml.apache.org/security/ {4}
The root cause was: org/apache/commons/logging/LogFactory

This happens whether I put xmlsec-1.2.1.jar in $CATALINA_HOME/common/lib or 
$CATALINA_HOME/common/endorsed.  When I put xmlsec-1.2.1.jar in 
$CATALINA_HOME/webapps/axis/WEB-INF/lib, the message was

See http://xml.apache.org/security/ {4}
The root cause was: {0}

What does this mean?  Should I be using an older version of xmlsec-1.2.1.jar?

On Friday 05 August 2005 09:58, Javier Gonzalez wrote:
> Where are xmlsec.jar and activation.jar located? (the hint that the
> error message told you)
>
> IIRC, in Tomcat the classloaders are ordered like this: webapp ->
> shared -> common -> system. The classloaders can look in that order
> and not in the reverse order. That is, if A.jar is on the webapp lib
> dir, B.jar is in shared/lib, and A depends on B, it's ok, since the
> webapp classloader can ask the next classloader for B. But if B
> depends on A, then you'll have an error because the shared classloader
> can't look "back" into the webapp classloader.
>
> On 8/5/05, Jonathan J. Vargas R. <jo...@gmail.com> wrote:
> > Greets,
> >
> > I tried to install xmlsec into axis, but seems axis has problems doing
> > this. The problem is with xmlsec, but I still don't know how to solve
> > it or fix it. I am using tomcat, This is the happyaxis report:
> >
> >
> > Optional Components
> >
> >
> > Warning: could not find a dependency of class
> > org.apache.xml.security.Init from file xmlsec.jar
> > XML Security is not supported
> > See http://xml.apache.org/security/
> > The root cause was: org/apache/xpath/compiler/FuncLoader
> > This can happen e.g. if org.apache.xml.security.Init is in the
> > 'common' classpath, but a dependency like activation.jar is only in
> > the webapp classpath.
> >
> > Found Java Secure Socket Extension (javax.net.ssl.SSLSocketFactory) at
> > an unknown location

Re: Happyaxis reports problems loading libraries, found but with problems

Posted by Javier Gonzalez <ja...@gmail.com>.
Where are xmlsec.jar and activation.jar located? (the hint that the
error message told you)

IIRC, in Tomcat the classloaders are ordered like this: webapp ->
shared -> common -> system. The classloaders can look in that order
and not in the reverse order. That is, if A.jar is on the webapp lib
dir, B.jar is in shared/lib, and A depends on B, it's ok, since the
webapp classloader can ask the next classloader for B. But if B
depends on A, then you'll have an error because the shared classloader
can't look "back" into the webapp classloader.

On 8/5/05, Jonathan J. Vargas R. <jo...@gmail.com> wrote:
> Greets,
> 
> I tried to install xmlsec into axis, but seems axis has problems doing
> this. The problem is with xmlsec, but I still don't know how to solve
> it or fix it. I am using tomcat, This is the happyaxis report:
> 
> 
> Optional Components
> 
> 
> Warning: could not find a dependency of class
> org.apache.xml.security.Init from file xmlsec.jar
> XML Security is not supported
> See http://xml.apache.org/security/
> The root cause was: org/apache/xpath/compiler/FuncLoader
> This can happen e.g. if org.apache.xml.security.Init is in the
> 'common' classpath, but a dependency like activation.jar is only in
> the webapp classpath.
> 
> Found Java Secure Socket Extension (javax.net.ssl.SSLSocketFactory) at
> an unknown location
> 
> 
> --
> Jonathan J. Vargas Rodriguez
> jonathan.j.vargas@gmail.com
> "Conservar el silencio interior cuando vuelo en la tormenta me es
> mejor, porque asi ya no soy otra gota de la tempestad"
> 


-- 
Javier Gonzalez Nicolini