Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Error Attempting to Generate Servlet in Dynamic Web Project
Error Attempting to Generate Servlet in Dynamic Web Project [message #181399] Tue, 10 October 2006 22:54 Go to next message
Eclipse User
Originally posted by: Russell_longo.stercomm.com

Hello,

Wanted to see if anyone has any insights into where I may be going wrong.
Here are the steps I've taken so far in sequential order:

1)Installed Java EE 5 SDK (the SUN site indicated this was required for
web app development; had the appropriate classes)

2) downloaded the Eclipse all-in-one zip file (200+MB) and unzipped to
local directory

3) started up Eclipse->New Project->Web->Dynamic Web Project

4) Project defaulted to the JRE libraries; however, I also added an
additional libary to the build path, since I know the right Jars were not
in the default directory. These additional libraries do show up in the
project as expected.

5)Right clicked Servlet icon->New->Servlet. The servlet wizard pops up.
I gave it a class name, didnt indicate any package, and went with all
defaults on the next three screens.

Received following error on a dialog box: An error has occured when
Create Servlet has finished.

I click details, and there are two errors listed along with a numerous
other lines.

org.eclipse.core.runtime.CoreException: Extended Operation failure:
org.eclipse.jst.j2ee.internal.web.operations.AddServletOpera tion

org.eclipse.core.runtime.CoreException[0]:
java.lang.UnsupportedClassVersionError:
org/eclipse/jst/j2ee/web/ServletTemplate (Unsupported major.minor version
49.0)

I've scoured this site, went to the Eclipse bug site, and googled partial
string of the above. Didn't find any meaningful clues on the issue.

Any help would be appreciated - Thanks!

Russell Longo
Re: Error Attempting to Generate Servlet in Dynamic Web Project [message #181433 is a reply to message #181399] Wed, 11 October 2006 14:21 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1310
Registered: July 2009
Senior Member
Googling "Unsupported major.minor version 49.0" will give you lots of
hits. It means that J2SE 1.4, or earlier, tried to load a class that
was compiled for J2SE 5.0 and can't because doesn't know the format for
that version of class file. It's not clear to me what it is about your
configuration is causing this to occur.

Cheers,
Larry

Russell Longo wrote:
> Hello,
>
> Wanted to see if anyone has any insights into where I may be going
> wrong. Here are the steps I've taken so far in sequential order:
>
> 1)Installed Java EE 5 SDK (the SUN site indicated this was required for
> web app development; had the appropriate classes)
>
> 2) downloaded the Eclipse all-in-one zip file (200+MB) and unzipped to
> local directory
>
> 3) started up Eclipse->New Project->Web->Dynamic Web Project
>
> 4) Project defaulted to the JRE libraries; however, I also added an
> additional libary to the build path, since I know the right Jars were
> not in the default directory. These additional libraries do show up in
> the project as expected.
>
> 5)Right clicked Servlet icon->New->Servlet. The servlet wizard pops
> up. I gave it a class name, didnt indicate any package, and went with
> all defaults on the next three screens.
>
> Received following error on a dialog box: An error has occured when
> Create Servlet has finished.
>
> I click details, and there are two errors listed along with a numerous
> other lines.
>
> org.eclipse.core.runtime.CoreException: Extended Operation failure:
> org.eclipse.jst.j2ee.internal.web.operations.AddServletOpera tion
>
> org.eclipse.core.runtime.CoreException[0]:
> java.lang.UnsupportedClassVersionError:
> org/eclipse/jst/j2ee/web/ServletTemplate (Unsupported major.minor
> version 49.0)
>
> I've scoured this site, went to the Eclipse bug site, and googled
> partial string of the above. Didn't find any meaningful clues on the
> issue.
>
> Any help would be appreciated - Thanks!
>
> Russell Longo
>
Re: Error Attempting to Generate Servlet in Dynamic Web Project [message #181448 is a reply to message #181399] Wed, 11 October 2006 14:37 Go to previous messageGo to next message
Eclipse User
Originally posted by: kosta.bea.com

It looks like you have another version of java sdk installed on your
machine (probably 1.4) and eclipse is launching with that instead of
your 5.0 vm. You can try using a -vm parameter in the eclipse.ini file
to specify the vm to run with.

- Konstantin
Re: Error Attempting to Generate Servlet in Dynamic Web Project [message #181535 is a reply to message #181448] Thu, 12 October 2006 07:16 Go to previous message
Eclipse User
Originally posted by: rlongo.cox.net

I want to thank both Larry and Konstantin for their comments. It appears
the problem indeed was caused by the existence of other Java JDK installs.
In fact there were two others.

In an effort to contribute to the newsgroup, I'll explain what I did. It
may help someone else just starting with the tool:

1) I tried editing the eclipse.ini file first. I added the line
-vm C:\Sun\AppServer\jdk\bin\
-vm C:\Sun\AppServer\jdk\bin\java

None of the above worked while the other SDK 1.4 was still loaded.

2) I uninstalled the 1.4 JDK Control Panel->Add/Remove Programs->Java JDK
1.4x

3) Now eclipse would not start because it indicated it could not find the
location of the javaw.exe file

4) I went back to Eclipse.ini file and changed the line to
-vm C:\Sun\AppServer\jdk\bin\javaw.exe

This also didn't work.

5) Finally, I went to the user PATH variable for the OS environment
(System Properties->Advanced->Environment Variables)to point to
C:\sun\appserver\jdk\bin

6)Eclipse was able to start back up

7)Tried the Servlet Wizard again...it worked!

Some notes:

I may still need to install JDK 1.4 back on my machine (my companies
software may not run under J2EE 5). I changed the JAVA_HOME environment
variable to point to C:\sun\appserver\jdk. Interested to see if Eclipse
defaults back to JDK 1.4x.
Previous Topic:Eclipse 3.2.1 / WTP 1.5 starts geronimo 1.1 but cannot deploy war
Next Topic:Turning off validator in JUnit tests
Goto Forum:
  


Current Time: Sat Oct 25 19:07:54 GMT 2014

Powered by FUDForum. Page generated in 0.10677 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software