You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kien Vo <vo...@outlook.com> on 2015/12/28 08:24:15 UTC

Fail to start Tomcat 8 with xerces library

Hi all,

 

I encountered this error when starting Tomcat 8 with
xerces library. Any help appreciated!

 

I put xerces.jar in this folder C:\tomcat8\endorsed. If I
don't put it there, Tomcat does not load that library at all. My application
gets "NoSuchMethodException".

 

Tomcat server:            8.0.30.0

JVM Version:          
    1.7.0_51-b13 (32 bit)

OS Name:             
      Windows 7 (64 bit)

OS Version:           
     6.1

 

org.w3c.dom.ls.LSException:
java.lang.NullPointerException

            at
com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)

            at
org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)

            at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)

            at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

            at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)

            at
org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)

            at
org.apache.catalina.startup.Catalina.load(Catalina.java:576)

            at
org.apache.catalina.startup.Catalina.load(Catalina.java:599)

            at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at
java.lang.reflect.Method.invoke(Unknown Source)

            at
org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)

            at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)

Dec 28, 2015 2:07:29 PM
org.apache.catalina.startup.Catalina start

SEVERE: The required Server component failed to start so
Tomcat is unable to start.

org.apache.catalina.LifecycleException: An invalid
Lifecycle transition was attempted ([before_start]) for component
[StandardServer[8005]] in state [INITIALIZING]

            at
org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:409)

            at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:144)

            at
org.apache.catalina.startup.Catalina.start(Catalina.java:625)

            at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

            at
java.lang.reflect.Method.invoke(Unknown Source)

            at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)

            at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) 		 	   		   		 	   		  

Re: Fail to start Tomcat 8 with xerces library

Posted by Mark Thomas <ma...@apache.org>.
On 28/12/2015 07:24, Kien Vo wrote:
> Hi all,
> 
> I encountered this error when starting Tomcat 8 with
> xerces library. Any help appreciated!
> 
> I put xerces.jar in this folder C:\tomcat8\endorsed. If I
> don't put it there, Tomcat does not load that library at all. My application
> gets "NoSuchMethodException".
> 
> Tomcat server:            8.0.30.0
> JVM Version:          
>     1.7.0_51-b13 (32 bit)
> OS Name:             
>       Windows 7 (64 bit)
> OS Version:           
>      6.1

That version information is helpful but it doesn't include the Xerces
version. There have been quite a few Xerces releases so the version is
important.

> org.w3c.dom.ls.LSException:
> java.lang.NullPointerException
> 
>             at
> com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)
> 
>             at
> org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)

Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener?
If not, take a look. If yes, you should be able to ask a more specific
question.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Fail to start Tomcat 8 with xerces library

Posted by Kien Vo <vo...@outlook.com>.
> Date: Mon, 28 Dec 2015 16:12:46 +0300
> Subject: Re: Fail to start Tomcat 8 with xerces library
> From: knst.kolinko@gmail.com
> To: users@tomcat.apache.org
> 
> 2015-12-28 12:17 GMT+03:00 Kien Vo <vo...@outlook.com>:
> > My current xerces version is 2.6.1.
> > My app used Tomcat 7 without any issues. But upgrading to Tomcat 8 got that error.
> > Is there any way to by-pass this error?
> >
> >> Subject: Re: Fail to start Tomcat 8 with xerces library
> >> To: users@tomcat.apache.org
> >> From: markt@apache.org
> >> Date: Mon, 28 Dec 2015 07:58:14 +0000
> >>
> >> On 28/12/2015 07:24, Kien Vo wrote:
> >> > Hi all,
> >> >
> >> > I encountered this error when starting Tomcat 8 with
> >> > xerces library. Any help appreciated!
> >> >
> >> > I put xerces.jar in this folder C:\tomcat8\endorsed. If I
> >> > don't put it there, Tomcat does not load that library at all. My application
> >> > gets "NoSuchMethodException".
> >> >
> >> > Tomcat server:            8.0.30.0
> >> > JVM Version:
> >> >     1.7.0_51-b13 (32 bit)
> >> > OS Name:
> >> >       Windows 7 (64 bit)
> >> > OS Version:
> >> >      6.1
> >>
> >> That version information is helpful but it doesn't include the Xerces
> >> version. There have been quite a few Xerces releases so the version is
> >> important.
> >>
> >> > org.w3c.dom.ls.LSException:
> >> > java.lang.NullPointerException
> >> >
> >> >             at
> >> > com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)
> >> >
> >> >             at
> >> > org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)
> >>
> >> Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener?
> >> If not, take a look. If yes, you should be able to ask a more specific
> >> question.
> >>
> 
> Rules:
> http://tomcat.apache.org/lists.html#tomcat-users
> -> 6. Top-posting is bad.
> 
> 
> Placing the library into "\endorsed" directory means that you are
> trying to replace JRE-provided implementation of XML APIs with a 3rd
> party one.
> 
> If you are doing so, you must use XML library that implements the same
> set of APIs and the same specification level as implemented in JRE.
> Xerces-J 2.6.1 was released in January 2004, so there is no wonder
> that it cannot be used as replacement implementation  and fails in
> strange ways.  Try with the current version (2.11.0).
> 
> http://xerces.apache.org/#xerces2-j
> 
> 
> Actually placing something into "\endorsed" does not replace the
> existing library inside of JRE, but just places the new library in
> front of bootstrap classpath. So in your case the JRE operates on a
> mix of up-to-date and historic classes.
> 
> Best regards,
> Konstantin Kolinko
> 
> ---------------------------------------------------------------------

Thanks Kolinko and Mark. I solved my issue.
I used the latest version of Xerces library (2.11.0), put "xercesImpl.jar" and "xml-apis.jar" in TOMCAT_HOME/endorsed folder. 		 	   		  

Re: Fail to start Tomcat 8 with xerces library

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-12-28 12:17 GMT+03:00 Kien Vo <vo...@outlook.com>:
> My current xerces version is 2.6.1.
> My app used Tomcat 7 without any issues. But upgrading to Tomcat 8 got that error.
> Is there any way to by-pass this error?
>
>> Subject: Re: Fail to start Tomcat 8 with xerces library
>> To: users@tomcat.apache.org
>> From: markt@apache.org
>> Date: Mon, 28 Dec 2015 07:58:14 +0000
>>
>> On 28/12/2015 07:24, Kien Vo wrote:
>> > Hi all,
>> >
>> > I encountered this error when starting Tomcat 8 with
>> > xerces library. Any help appreciated!
>> >
>> > I put xerces.jar in this folder C:\tomcat8\endorsed. If I
>> > don't put it there, Tomcat does not load that library at all. My application
>> > gets "NoSuchMethodException".
>> >
>> > Tomcat server:            8.0.30.0
>> > JVM Version:
>> >     1.7.0_51-b13 (32 bit)
>> > OS Name:
>> >       Windows 7 (64 bit)
>> > OS Version:
>> >      6.1
>>
>> That version information is helpful but it doesn't include the Xerces
>> version. There have been quite a few Xerces releases so the version is
>> important.
>>
>> > org.w3c.dom.ls.LSException:
>> > java.lang.NullPointerException
>> >
>> >             at
>> > com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)
>> >
>> >             at
>> > org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)
>>
>> Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener?
>> If not, take a look. If yes, you should be able to ask a more specific
>> question.
>>

Rules:
http://tomcat.apache.org/lists.html#tomcat-users
-> 6. Top-posting is bad.


Placing the library into "\endorsed" directory means that you are
trying to replace JRE-provided implementation of XML APIs with a 3rd
party one.

If you are doing so, you must use XML library that implements the same
set of APIs and the same specification level as implemented in JRE.
Xerces-J 2.6.1 was released in January 2004, so there is no wonder
that it cannot be used as replacement implementation  and fails in
strange ways.  Try with the current version (2.11.0).

http://xerces.apache.org/#xerces2-j


Actually placing something into "\endorsed" does not replace the
existing library inside of JRE, but just places the new library in
front of bootstrap classpath. So in your case the JRE operates on a
mix of up-to-date and historic classes.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Fail to start Tomcat 8 with xerces library

Posted by Mark Thomas <ma...@apache.org>.
On 28/12/2015 09:17, Kien Vo wrote:
> My current xerces version is 2.6.1.

Thanks.

> My app used Tomcat 7 without any issues. But upgrading to Tomcat 8 got that error.

Again, you need to be specific about versions. Tomcat 7.0.what?

> Is there any way to by-pass this error?

Try answering my previous question about line 447 of Tomcat's
JreMemoryLeakPreventionListener

Mark


> 
>> Subject: Re: Fail to start Tomcat 8 with xerces library
>> To: users@tomcat.apache.org
>> From: markt@apache.org
>> Date: Mon, 28 Dec 2015 07:58:14 +0000
>>
>> On 28/12/2015 07:24, Kien Vo wrote:
>>> Hi all,
>>>
>>> I encountered this error when starting Tomcat 8 with
>>> xerces library. Any help appreciated!
>>>
>>> I put xerces.jar in this folder C:\tomcat8\endorsed. If I
>>> don't put it there, Tomcat does not load that library at all. My application
>>> gets "NoSuchMethodException".
>>>
>>> Tomcat server:            8.0.30.0
>>> JVM Version:          
>>>     1.7.0_51-b13 (32 bit)
>>> OS Name:             
>>>       Windows 7 (64 bit)
>>> OS Version:           
>>>      6.1
>>
>> That version information is helpful but it doesn't include the Xerces
>> version. There have been quite a few Xerces releases so the version is
>> important.
>>
>>> org.w3c.dom.ls.LSException:
>>> java.lang.NullPointerException
>>>
>>>             at
>>> com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)
>>>
>>>             at
>>> org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)
>>
>> Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener?
>> If not, take a look. If yes, you should be able to ask a more specific
>> question.
>>
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>  		 	   		  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Fail to start Tomcat 8 with xerces library

Posted by Kien Vo <vo...@outlook.com>.
My current xerces version is 2.6.1.
My app used Tomcat 7 without any issues. But upgrading to Tomcat 8 got that error.
Is there any way to by-pass this error?

> Subject: Re: Fail to start Tomcat 8 with xerces library
> To: users@tomcat.apache.org
> From: markt@apache.org
> Date: Mon, 28 Dec 2015 07:58:14 +0000
> 
> On 28/12/2015 07:24, Kien Vo wrote:
> > Hi all,
> > 
> > I encountered this error when starting Tomcat 8 with
> > xerces library. Any help appreciated!
> > 
> > I put xerces.jar in this folder C:\tomcat8\endorsed. If I
> > don't put it there, Tomcat does not load that library at all. My application
> > gets "NoSuchMethodException".
> > 
> > Tomcat server:            8.0.30.0
> > JVM Version:          
> >     1.7.0_51-b13 (32 bit)
> > OS Name:             
> >       Windows 7 (64 bit)
> > OS Version:           
> >      6.1
> 
> That version information is helpful but it doesn't include the Xerces
> version. There have been quite a few Xerces releases so the version is
> important.
> 
> > org.w3c.dom.ls.LSException:
> > java.lang.NullPointerException
> > 
> >             at
> > com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)
> > 
> >             at
> > org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)
> 
> Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener?
> If not, take a look. If yes, you should be able to ask a more specific
> question.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: Fail to start Tomcat 8 with xerces library

Posted by Mark Thomas <ma...@apache.org>.
On 28/12/2015 07:24, Kien Vo wrote:
> Hi all,
> 
> I encountered this error when starting Tomcat 8 with
> xerces library. Any help appreciated!
> 
> I put xerces.jar in this folder C:\tomcat8\endorsed. If I
> don't put it there, Tomcat does not load that library at all. My application
> gets "NoSuchMethodException".
> 
> Tomcat server:            8.0.30.0
> JVM Version:          
>     1.7.0_51-b13 (32 bit)
> OS Name:             
>       Windows 7 (64 bit)
> OS Version:           
>      6.1

That version information is helpful but it doesn't include the Xerces
version. There have been quite a few Xerces releases so the version is
important.

> org.w3c.dom.ls.LSException:
> java.lang.NullPointerException
> 
>             at
> com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(DOMSerializerImpl.java:534)
> 
>             at
> org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:447)

Have you looked at line 447 of Tomcat's JreMemoryLeakPreventionListener?
If not, take a look. If yes, you should be able to ask a more specific
question.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org