• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use java class in jsp in weblogic

 
Sowmya Dhilip
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am working on weblogic workshop.
I am using a java class inside a jsp file like this.
Th jsp file is Orders.jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" import="javaSource.Connect"%>
<html>
<%
try
{
System.out.println("before connect");
Connect con = new Connect();
con.initialize();
//System.out.println("after connect");
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
%>
<body class="body">

</body>
</html>

and the java file is Connect.java
package javaSource;
import com.filenet.wcm.api.*;
import com.filenet.wcm.api.impl.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.util.xml.Serializer;
import org.apache.soap.util.mime.*;
import org.apache.soap.util.net.*;

public class Connect
{
Session sess;
String userid = "PEAdmin";
String pwd = null;
String appId = "DM.DubaiM.Connect";
String domain = "p8Domain";

public void initialize() throws Exception
{
try
{
System.out.println("inside initialize");
Session sess = ObjectFactory.getSession(appId,null,userid,pwd,domain);//,null,userid,pwd,domain
System.out.println(sess.verify());
System.out.println("after session");
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
/*System.out.println("verified session");
EntireNetwork netW = ObjectFactory.getEntireNetwork(sess);
System.out.println(netW.toString());
Domains doms = netW.getDomains();
Iterator iter = doms.iterator();
while (iter.hasNext())
{
Domain dom = (Domain)iter.next();
System.out.println(dom.getName());
}
ObjectStores objStores = netW.getObjectStores();
System.out.println("inside object store");
ObjectStore objStore = null;
iter = objStores.iterator();
while(iter.hasNext())
{
objStore = (ObjectStore) iter.next();
System.out.println(objStore.getName());
}
*/
}
}

when ever i run the jsp file i get an error saying,
before connect
inside initialize
<Jan 21, 2004 5:11:18 PM GMT+04:00> <Error> <HTTP> <BEA-101017> <[ServletContext
(id=17648350,name=DubaiM,context-path=/DubaiM)] Root cause of ServletException.
java.lang.NoClassDefFoundError: org/apache/soap/util/xml/Serializer
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at com.filenet.wcm.api.impl.RemoteCommand.<clinit>(RemoteCommand.java:65
0)
at com.filenet.wcm.api.impl.SessionImpl.getRemoteCommand(SessionImpl.jav
a:1020)
at com.filenet.wcm.api.impl.SessionImpl.verify(SessionImpl.java:347)
at javaSource.Connect.initialize(Connect.java:24)
at jsp_servlet.__orders1._jspService(Orders1.jsp:38)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
er.java:185)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6316)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
please help, as i need it desperately.
Regards,
Sowmya
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The important line of the error trace is:
java.lang.NoClassDefFoundError: org/apache/soap/util/xml/Serializer
This tells us that the mentioned class is not available to the web application.
If this class is part of a jar file, make sure that jar file is in WEB-INF/lib in your deployed application.
 
Sowmya Dhilip
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class is present in the jar file and is inside WEB-INF/lib,
even if i import it seperately i get the same error msg.
This is really urgent , pls help.
Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic