• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in Compiling servlets

 
renu richard
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When i tried compiling login.java,i got the below error.

But it is getting compiled fine if i set weblogic.jar in the classpath.

Can someone please tell me why it is not getting compiled with the servlets-api.jar.
[ October 07, 2008: Message edited by: ren_richard ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ypren", please check your private messages for an important administrative matter.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ypren welcome to Javaranch ,

Firstly use code tags for your code. Unformatted code is hard to read and results in less response for your post. You can add code tags by editing your post, to edit the post click the .

The reason you are experiencing the problem is the version incompatibility.
Which versions of Weblogic and Java are you using?
 
renu richard
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Amit for your valuable comments.

Weblogic version : 8.1
Java version : Tried using both JDK1.4 and 1.6
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15217
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ren_richard" - first, please check your private messages again.

The following line in the error message that you get:

class file has wrong version 49.0, should be 48.0

Suggests that you are using classes that were compiled with JDK 5.0, and you are trying to use them with JDK 1.4. That will not work.

I see that you are using Tomcat 6.0. That version of Tomcat requires JDK 5.0 or newer. The JAR files in that version of Tomcat are compiled with JDK 5.0, so you will get into trouble if you try to use those JAR files on Java 1.4.

Use the JAR files that you get with Weblogic 8.1 to compile and run your application instead of those you get with Tomcat 6.0.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic