When Tomcat is started, a strange error cannot be found in the class!

Source: Internet
Author: User

The following error occurs during startup:

[Warn] com. Sun. Faces. config. Rules. converterrule. End (converterrule. Java: 127)-[converterrule] {faces-config/Converter} Merge (omnipotentconverter, null)
Java. Lang. classnotfoundexception: [ljava. Lang. String;
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1355)
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1201)
At com. Sun. Faces. config. configurelistener. Configure (configurelistener. Java: 615)
At com. Sun. Faces. config. configurelistener. Configure (configurelistener. Java: 402)
At com. Sun. Faces. config. configurelistener. contextinitialized (configurelistener. Java: 328)
At org. Apache. Catalina. Core. standardcontext. listenerstart (standardcontext. Java: 3763)
At org. Apache. Catalina. Core. standardcontext. Start (standardcontext. Java: 4211)
At org. Apache. Catalina. Core. containerbase. addchildinternal (containerbase. Java: 759)
At org. Apache. Catalina. Core. containerbase. addchild (containerbase. Java: 739)
At org. Apache. Catalina. Core. standardhost. addchild (standardhost. Java: 524)
At org. Apache. Catalina. startup. hostconfig. deploydirectory (hostconfig. Java: 904)
At org. Apache. Catalina. startup. hostconfig. deploydirectories (hostconfig. Java: 867)
At org. Apache. Catalina. startup. hostconfig. deployapps (hostconfig. Java: 474)
At org. Apache. Catalina. startup. hostconfig. Start (hostconfig. Java: 1122)
At org. Apache. Catalina. startup. hostconfig. lifecycleevent (hostconfig. Java: 310)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 119)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1021)
At org. Apache. Catalina. Core. standardhost. Start (standardhost. Java: 718)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1013)
At org. Apache. Catalina. Core. standardengine. Start (standardengine. Java: 442)
At org. Apache. Catalina. Core. standardservice. Start (standardservice. Java: 450)
At org. Apache. Catalina. Core. standardserver. Start (standardserver. Java: 709)
At org. Apache. Catalina. startup. Catalina. Start (Catalina. Java: 551)
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: 494)
At org. Apache. Catalina. startup. Bootstrap. Start (Bootstrap. Java: 294)
At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 432)
[Error] org. Apache. Catalina. Core. standardcontext. listenerstart (standardcontext. Java: 3767)-an exception occurred when an initialization event was sent to listenercom. Sun. Faces. config. configurelistener.
......

The project cannot be released successfully.

I have received a lot of talk on the Internet, including

 
  Re: Java. Lang. classnotfoundexception: [ljava. Lang. String;
Posted: Jun 2, 2006: 25 AM In response to: cayhorstmann
 
  Reply
Hi,

We have encountered a similar error a while back while
We were testing the JMX Ri.
In your case the culprit seems to be here:

Caused by: java.lang.ClassNotFoundException: [Ljava.lang.String;at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1508)

The problem is that the Catalina Code apparently CILS

ClassLoader.loadClass()

Instead of calling

Class.forName(String, boolean, ClassLoader)

Hope this helps,

-- Daniel

The problem you 've run into seems to have been caused by a regression in the Java runtime, and is independent of the webapp classloader.

In fact, it can be reproduced very easily using this test program:

Public class test {

Public static void main (string [] ARGs) throws exception {

String [] S = new string [] {& quot; 123 & quot "};
String clname = S. getclass (). getname ();
Test. Class. getclassloader (). loadclass (clname );
}
}

This program runs fine with JDK 1.5, but throws this exception on JDK 1.6:

Exception in thread "Main" Java. Lang. classnotfoundexception: [ljava. Lang. String;
At java.net. urlclassloader $ 1.run( urlclassloader. Java: 200)
At java. Security. accesscontroller. doprivileged (native method)
At java.net. urlclassloader. findclass (urlclassloader. Java: 188)
At java. Lang. classloader. loadclass (classloader. Java: 306)
At sun. Misc. launcher $ appclassloader. loadclass (launcher. Java: 276)
At java. Lang. classloader. loadclass (classloader. Java: 251)
At test. Main (test. Java: 7)

I'll file a P1 against JDK 1.6 and will update you as soon as I know more.

The content discussed here is similar to this issue. It can be seen that it mainly means that after Tomcat is started, it will load some class files written by developers themselves.

However, due to problems with the JDK version, some methods may be incompatible with the usage or usage changes, and the startup may fail.

According to this clue, I have observed a few places where JDK is used and found that the version is too low when Tomcat is started, so in eclipse

Its configuration to a higher version (jdk1.5.0.7) is originally jdk1.5, so Tomcat is successfully started. As to whether there is a problem with the change to jdk6.0, I have not

Lab, to be tested :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.