Web Hosting Forum | Lunarpages


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



Login with username, password and session length
February 09, 2012, 11:26:34 AM

Pages: [1]   Go Down
  Print  
Author Topic: Compiling servlets  (Read 2895 times)
lpcapp
Newbie
*
Offline Offline

Posts: 4


« on: March 05, 2010, 01:12:43 PM »

Sorry if it is a repeated question (I've searched a lot yet, and did not found anything to solve my problem)

I cannot compile servlets previous to uploading them to the server. I have tested uploading the .java source, and after Resin auto-compilation, everything works fine. But when I compile the servlet in my computer and upload it, it reports:
-----------------------------------------
500 Servlet Exception
javax.servlet.ServletException: Class `com.threeeff.trg.j2ee.MyServlet'
was not found in classpath.
Classes normally belong in /j2ee/WEB-INF/classes.
-----------------------------------------

Let me explain what I've done:
1. downloaded resin-2.1.17.zip and extracted "jsdk23.jar" and included in the classpath for compiling
2. with ant:
2.1 compile the class for java 1.4 target
2.2 build the webapp so:
2.2.1 MyServlet.class copies to j2ee/WEB-INF/classess/com/threeeff/trg/j2ee
2.2.1 jsdk23.jar is not included in j2ee/WEB-INF/lib

Please, can anybody tell me where is the mistake?

thanks, Juan.
Logged
afbarnes
Trekkie
**
Offline Offline

Posts: 12


« Reply #1 on: March 05, 2010, 02:58:09 PM »

I believe that your error is the following:

Change: MyServlet.class copies to j2ee/WEB-INF/classess/com/threeeff/trg/j2ee
To: MyServlet.class copies to j2ee/WEB-INF/classes/com/threeeff/trg/j2ee

You added an extra "s" to classes. 

Please let me know if this helps.

Thanks,

Andre F. Barnes
Logged
lpcapp
Newbie
*
Offline Offline

Posts: 4


« Reply #2 on: March 06, 2010, 06:32:17 AM »

Thanks for the details, but that was my mistake when writing the message.

That didn't solve te problem.

Juan.
Logged
lpcapp
Newbie
*
Offline Offline

Posts: 4


« Reply #3 on: March 08, 2010, 07:04:13 AM »

Any other clue?

Juan.
Logged
lpcapp
Newbie
*
Offline Offline

Posts: 4


« Reply #4 on: March 27, 2010, 01:42:45 PM »

FINALLY!!

 I've found the solution after painfull retries. The solution was to target the javac compilation to 1.4 version.

  My problem was to lack of better know-how on "ant" (I knew I needed to target compilation to 1.4) I was trying to target 1.4 version using "compiler" attribute in "javac" (ant) target. My solution was to use "source=1.4" and "target=1.4" attributes. So the line on ant must be:

<javac [...other attributes...] source="1.4" target="1.4"/>

Hope this help to others...

Juan.
Logged
fates66
Intergalactic Cowboy
*****
Offline Offline

Posts: 57


« Reply #5 on: March 28, 2010, 07:38:36 PM »

I have the same autocompiling problem on the Dewi server also and Rigal server else.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: