Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
September 30, 2014, 08:06:29 PM

Pages: [1]   Go Down
  Print  
Author Topic: ServletException  (Read 3931 times)
norte1
Space Explorer
***
Offline Offline

Posts: 7


« on: October 12, 2010, 12:12:35 PM »

Wow this issue is crazy prevalent to the LunarPages community.  I think many of us customers use Apache/Tomcat for their web server needs.  Sure LP  uses (what is new to me) Resin stuff.  Here's a link to another LP customer with the same issue as me, only four years ago.  It has no solution to it.  http://www.lunarforums.com/jsp_and_servlets_support/flustered_classpath_issues-t32816.0.html

I created some servlet code pre-compiled the classes on my local machine. 

I put the classes into the /public_html/WEB-INF/classes directory

then I updated the web.xml in the /public_html/WEB-INF directory

I put in the <servlet> and <servlet-mapping> entries so that I could name the action what I want in the JSP.   Here is the sample of the servlet mappings in the web.xml
  <servlet>
            <servlet-name>internal_getManufacturerList</servlet-name>
            <servlet-class>GetManufacturerList</servlet-class>
  </servlet>
  <servlet-mapping>
            <servlet-name>internal_getManufacturerList</servlet-name>
            <url-pattern>/GetManufacturerList.do</url-pattern>
  </servlet-mapping>

in my JSP I have some javascript to make the call
      ajaxRequest.open("POST", "GetManufacturerList.do", true);

Ultimately the servlet cannot be found.

Any help for me?




Logged
norte1
Space Explorer
***
Offline Offline

Posts: 7


« Reply #1 on: October 12, 2010, 12:45:17 PM »

Replying to my own post.  OK I found another post that had the same issue.  http://www.lunarforums.com/jsp_and_servlets_support/helloworld_servlet_is_throwing_class_not_found_exception-t40169.0.html

I guess they got some LP support staff to help out.  Basically their <url-pattern> was updated to have /servlet/ put in front of it.  I tried that and it did not work.

I'm reading something about waiting 15 minutes to check changes?  Does that mean web.xml changes need 15 minutes to take effect?  I guess that makes sense, on my local machine I just start and stop  Tomcat. 

I must resolve this problem. 
Logged
norte1
Space Explorer
***
Offline Offline

Posts: 7


« Reply #2 on: October 13, 2010, 04:45:44 AM »

Replying to my own posts is like laughing at my own jokes, I'm a geek, I do that too.

I'm going to post the different combinations of what I am trying.  I will let you know that LP support is helping me.  THey are going to update me to the Resin 3.x server that has JDK1.6.     Here is something of note, the exception thrown, look at the version of resin at the bottom.  2003?  I am running on  7 year old server software?


I am running <myhost>/nortech/pla.jsp, this pla.jsp file calls functions in the GetInfo.java file. 

javax.servlet.ServletException: Class `/GetInfo' was not found in classpath.
Classes normally belong in /nortech/WEB-INF/classes.
   at com.caucho.server.http.Application.instantiateServlet(Application.java:3193)
   at com.caucho.server.http.Application.createServlet(Application.java:3101)
   at com.caucho.server.http.Application.loadServlet(Application.java:3062)
   at com.caucho.server.http.QServletConfig.loadServlet(QServletConfig.java:435)
   at com.caucho.server.http.Application.getFilterChainServlet(Application.java:2806)
   at com.caucho.server.http.Application.buildFilterChain(Application.java:2762)
   at com.caucho.server.http.Invocation.service(Invocation.java:313)
   at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
   at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:344)
   at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
   at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
   at java.lang.Thread.run(Thread.java:534)
        Resin 2.1.10 (built Wed Jun 18 09:16:53 PDT 2003)


Resin 2.1.10 (built Wed Jun 18 09:16:53 PDT 2003)
« Last Edit: October 13, 2010, 04:56:35 AM by norte1 » Logged
norte1
Space Explorer
***
Offline Offline

Posts: 7


« Reply #3 on: October 14, 2010, 05:47:13 AM »

OK I guess support at LP has stated my servlets will work with the update to 3.x and java1.6.  I'm not sure if that's the case, because the location of classes and specifications for the web.xml have been standard for a long time.  Lets hope this works.
Logged
norte1
Space Explorer
***
Offline Offline

Posts: 7


« Reply #4 on: October 15, 2010, 11:37:26 AM »

They have updated it.  It did not work.

Man, now I have to learn resin and the exact way they deploy.  This should be so stupidly easy.   JSPs/Servlets are a specification, apache adheres to it.   I am pretty sure resin does as well.   classes go into the WEB-INF/classes directory, then should be accessible.  That should be end of story, has to be a combination of my web.xml and what URL I am hitting, and where the class files are put.  

Ridiculous.  I have to learn a new server deploy, it should not have to be this way.  

Can someone out there in the lunar pages client base help me?
Logged
norte1
Space Explorer
***
Offline Offline

Posts: 7


« Reply #5 on: October 18, 2010, 04:18:57 AM »

I guess I jumped the gun on Friday.  The update did fix my problems Clapping  I made no changes to the code, out of curiosity I tried it on the weekend from home, and it worked.  There are other issues with the JDBC, but those are my issues.

I'm glad it is fixed, but when I first called LP Support they brushed me off a bit.  I am not sure what they proposed was a solution to fix my problem, rather a kind of default "Lets try this" approach, and that is not good.  However those are front-line support people, and I can't fault them.  They'd have no  chance of knowing the answer to why code deployed to JSP/servlet specifications was not working on that server. 

The second line support guys did not dig very deep.  I guess they have learned that 99% of the time it is client code, not an upgraded server.  I don't know, I did not appreciate the brush off.   In any case.  I hope my week long frustration has helped some of you.  I can't imagine "upgrade the server" is going to work for everyone though.   





Logged
Pages: [1]   Go Up
  Print  
 
Jump to: