servlets - java.lang.ClassNotFoundException: com.google.gson.Gson despite having the JAR in the Apache server -


Read many posts about the same error on StackHowflow but I still get the following error (stacktrace):

  31 Julai 2014 3:08:54 PM org.apache.catalina.loader.WebappClassLoader.loadClass to org.apache.catalina.core.StandardWrapperValve call: Servlet.service () (WebappClassLoader.java : 1680) threw com.google.gson.Gson: servlet TEST_Authenticate on org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader exception java.lang.ClassNotFoundException Java: 1526) TEST_Authenticate.doGet (TEST_Authenticate.java:70) Javax.servlet.http.HttpServlet.service (HttpServlet.java:668) at javax.servlet.http.HttpServlet.service On Su (HttpServlet.java:770) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290) org.apache on org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206). on catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java3333) nvoke on org.apache.catalina.core.StandardContextValve.i (StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java: 127) org.apache.catalina.connector.CoyoteAdapter .catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109) on org.apache on org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:103) .service (CoyoteAdapter.java jun93) org.apache.coyote.http11.Http11Processor.process at (Http11Processor.java: java org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process (Http11Protocol.java:606) org .apache.tomcat.util.ne Less than 861 in t.JIoEndpoint $ Worker.run (JIoEndpoint.java:489). Lang.Thread.run (Thread.java:744)  

Line # 70 in my code as follows:

  out.println (new gsn () .toJson (TESTAuthenticate ("myemail@mydomain.com")));  

I am using Netbeen and this is the structure of my project.

Enter image details here

I have jars in my server Is included in the lib folder as shown in the diagram above.

Someone answered, "Have you added a jar to your webpad / web-INF / Lib folder?" However, in the lib folder web-INF as shown in the image above I'm wondering what I'm doing wrong?

Renewed new screenshot gsn-2.2.4.jar

I have never used Netbeen but I think that you have to differentiate between the inner chamberpath and the class of your application for the tomatact engine, Tomcat separates this so that the web application can use similar versions of libraries. The area is not required, which uses Tomkat. GSN with the library there is no other way to define your project dependencies? Using eg Meven dependency and generate the project files.

Second It is that I notice: What is the content of GSN-2.2.4-Javadock.jpg? It contains class or just Javadoc HTML files.

Generally when the war file (using the menu) If this is the relationship, then this dependency will be added to the generated web file in the Web-INF / UIB folder.

>

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -