ExceptionInInitializerError in Castor

R

Ravi M

Hi All,
I am using castor -0.96 to marshall and unmarshall the xml
file. Following is the scenario where I am having problem.

I use castor to generate the xml file and convert into a byte array and
make a call to a remote service using axis. Now the webservice tries to
unmarshall the byte array using castor. I tried printing the byte array
and it prints the exact xml file that is being sent by the application
calling this webservice. I am running axis on Tomcat 4.1.29
But when I try to unmarshall the byte array, I get the
following error


Could sombody please help as to what I am doing wrong.

Thanks in advance.
Ravi

java.lang.ExceptionInInitializerError
at
org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272)
at
org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:225)
at
org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:212)
at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:736)
at webservices.PCSABean.unmarshal(PCSABean.java:363)
at webservices.PCSA.add(PCSAAxisService.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.axis.providers.java.RPCProvider.invokeMethod
(RPCProvider.j
ava:402)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider
..java:309)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
333)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java :120)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481
)
at
org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at org.apache.axis.transport.http.AxisServlet.doPost
(AxisServlet.java:85
4)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBas
e.java:339)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext (StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java :643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2417)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java :643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
3)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:781)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:549)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:589)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:666)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurati
onException: Class org.apache.commons.logging.impl.Log4JLogger does not
implemen
t Log
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:532)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance
(LogFactory
Impl.java:272)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:246)
at
org.exolab.castor.util.LocalConfiguration.<clinit>(LocalConfiguration
..java:105)
... 51 more
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log
4JLogger does not implement Log
at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:416)
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:525)
... 54 more
Caused by: org.apache.commons.logging.LogConfigurationException: Class
org.apach
e.commons.logging.impl.Log4JLogger does not implement Log
at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor (LogF
actoryImpl.java:412)
... 55 more
 
J

John C. Bollinger

Ravi said:
I use castor to generate the xml file and convert into a byte array and
make a call to a remote service using axis. Now the webservice tries to
unmarshall the byte array using castor. I tried printing the byte array
and it prints the exact xml file that is being sent by the application
calling this webservice. I am running axis on Tomcat 4.1.29
But when I try to unmarshall the byte array, I get the
following error
[...]

java.lang.ExceptionInInitializerError
at
org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272)
at
org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:225)
at

A variable initializer of class org.exolab.castor.xml.Unmarshaller threw
an exception. Specifically:

[...]
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurati
onException: Class org.apache.commons.logging.impl.Log4JLogger does not
implemen
t Log
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:532)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance
(LogFactory
Impl.java:272)
at

[...]

Since it seems exceedingly unlikely that one of the Commons Logging's
own loggers would fail to implement its Log interface, the most likely
scenario is multiple versions of the Commons Logging package in the
classpath. This sort of thing sometimes happens when an application or
package, such as Axis, Castor, or Tomcat comes packaged with various
external libraries, such as Commons Logging. It is possible for
multiple versions of the same package to coexist peacefully, but it is
necessary to exercise some care to get it right. In short, look into
the server configuration.
 
R

Ravi M

Hi John,
Thank you very much for reply. I forgot to remove the
commons-loging.jar that comes with axis, thus had two versions of
commons-loging.jar in both tomcat/lib and
tomcat/webapps/axis/web-inf/lib. Once I remove the commons-logging.jar
from the tomcat/webapps/axis/web-inf/lib it worked.

Thanks again.
Ravi
Ravi said:
I use castor to generate the xml file and convert into a byte array and
make a call to a remote service using axis. Now the webservice tries to
unmarshall the byte array using castor. I tried printing the byte array
and it prints the exact xml file that is being sent by the application
calling this webservice. I am running axis on Tomcat 4.1.29
But when I try to unmarshall the byte array, I get the
following error
[...]

java.lang.ExceptionInInitializerError
at
org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272)
at
org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:225)
at

A variable initializer of class org.exolab.castor.xml.Unmarshaller threw
an exception. Specifically:

[...]
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurati
onException: Class org.apache.commons.logging.impl.Log4JLogger does not
implemen
t Log
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:532)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance
(LogFactory
Impl.java:272)
at

[...]

Since it seems exceedingly unlikely that one of the Commons Logging's
 
R

Ravi M

Hi John,
Thank you very much for reply. I forgot to remove the
commons-loging.jar that comes with axis, thus had two versions of
commons-loging.jar in both tomcat/lib and
tomcat/webapps/axis/web-inf/lib. Once I remove the commons-logging.jar
from the tomcat/webapps/axis/web-inf/lib it worked.

Thanks again.
Ravi
Ravi said:
I use castor to generate the xml file and convert into a byte array and
make a call to a remote service using axis. Now the webservice tries to
unmarshall the byte array using castor. I tried printing the byte array
and it prints the exact xml file that is being sent by the application
calling this webservice. I am running axis on Tomcat 4.1.29
But when I try to unmarshall the byte array, I get the
following error
[...]

java.lang.ExceptionInInitializerError
at
org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272)
at
org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:225)
at

A variable initializer of class org.exolab.castor.xml.Unmarshaller threw
an exception. Specifically:

[...]
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurati
onException: Class org.apache.commons.logging.impl.Log4JLogger does not
implemen
t Log
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:532)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance
(LogFactory
Impl.java:272)
at

[...]

Since it seems exceedingly unlikely that one of the Commons Logging's
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top