-
how to deploy a servlet using weblogic8.1
Dear all,
I wanted to deploy a simple servlet using Weblogic8.1 so an an example i took the HelloServlet example which displays the HelloWorld as the output on to the browser
The steps which i followed were
1. Created BibleApp directory under D:\bea\user_projects\mydomain\applications
2. Under BibleApp directory,i created WEB-INF directory.
3. Under WEB_INF, created Classes directory.
4. In this Classes directory, i placed my HelloServlet.class file(following the package structure i.e classes\hello\HelloServlet.class)
5. And under WEB_INF, i placed the web.xml file.
6. I deployed the new Web Application using admin console.
7. Finally When i tried to invoke the Servlet, using the URL : localhost:7001/BibleApp/HelloServlet
it is giving me the following error
Error 500--Internal Server Error
javax.servlet.ServletException: [HTTP:101249][ServletContext(id=11983248,name=BibleApp,context-path=/BibleApp)]: Servlet class hello.HelloServlet for servlet HelloServlet could not be loaded because the requested class was not found in the classpath D:\bea\user_projects\mydomain\applications\BibleApp;D:\bea\user_projects\mydomain\applicat ions\BibleApp\WEB-INF\classes;D:\bea\user_projects\mydomain\.\myserver\.wlnotdelete\extract\myserver_BibleAp p_BibleApp\jarfiles\WEB-INF\lib\hello156250.jar;D:\bea\user_projects\mydomain\myserver\.wlnotdelete\extract\myserv er_BibleApp_BibleApp.
java.lang.UnsupportedClassVersionError: hello/HelloServlet (Unsupported major.minor version 49.0).
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:794)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:504)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:349)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletCo ntext.java:6291)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:357 5)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
so would any body plsss tell me how to ged rid of this problem. I dont know where exactly i am stuck
1)should i set any classpath or path(but in environmental variables i have set the following
1.1)CLASSPATH = D:\bea\weblogic81\server\lib\weblogic.jar
1.2)PATH = D:\bea\jdk141_02\bin)
2)or should i run any command script(setEnv.cmd) before deploying
3)one more thing when i installed Weblogic8.1, within the D:\bea\user_projects\mydomain\applications directory there is a
empty folder called .wlnotdelete (i dont know whether this is causing the problem)
4)In one of the webpage i read that
In the Classes directory, place your war file (package your Servlet and other classes into a war file using jar utility) is this is what i have to do, and if it is so how to create a war file
anybody plsss help me
thanks in advance
kasak
-
java.lang.UnsupportedClassVersionError: hello/HelloServlet (Unsupported major.minor version 49.0) -- means you are compiling your .java files in jdk 1.5 and running in 1.4 .
-
Can you send me your web.xml file
-
 Originally Posted by Born2Kode
 Can you send me your web.xml file
This exception can occur when the source is built targeting a JDK that is not supported by the JDK attempting to run it. In the above example, if the servlet was built targeting only JDK 1.5, but the web server runs JDK 1.4, the above exception will occur.
Check, Project Properties | Build | Java | Target VM, and verify that the Target VM indicates a JDK compatibility that is appropriate for the JDK that is running it. It is recommended to set this field to 'All Java SDKs' for the most compatibility. The only reason you would want to specify a particular version is if your code uses language features that only appear in a particular verison of the JDK, and you want to ensure that users use only a compatible JDK.
Also check, Project Properties | Build | Java | Language Features, and verify that the Language Features are applicable with JDK that is running it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks