Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2005

Tip: Looking for answers? Try searching our database.

ExceptionInInitializerError in Castor

Thread view: 
Ravi M - 28 Apr 2005 16:30 GMT
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
John C. Bollinger - 28 Apr 2005 22:34 GMT
> 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
[quoted text clipped - 3 lines]
>          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
[quoted text clipped - 10 lines]
> 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.

Signature

John Bollinger
jobollin@indiana.edu

Ravi M - 29 Apr 2005 19:38 GMT
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

> > 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
[quoted text clipped - 8 lines]
> > java.lang.ExceptionInInitializerError
> >         at

org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272)
> >         at
> > org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:225)
[quoted text clipped - 13 lines]
> > 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)
[quoted text clipped - 3 lines]
>
> 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
[quoted text clipped - 3 lines]
> 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.
Ravi M - 29 Apr 2005 20:00 GMT
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

> > 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
[quoted text clipped - 8 lines]
> > java.lang.ExceptionInInitializerError
> >         at

org.exolab.castor.xml.Unmarshaller.initConfig(Unmarshaller.java:272)
> >         at
> > org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:225)
[quoted text clipped - 13 lines]
> > 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)
[quoted text clipped - 3 lines]
>
> 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
[quoted text clipped - 3 lines]
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.