wood burning stoves
The moose likes Websphere and the fly likes Application runs only inside WSAD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Application runs only inside WSAD" Watch "Application runs only inside WSAD" New topic

Application runs only inside WSAD

Francisco A Guimaraes
Ranch Hand

Joined: Mar 20, 2002
Posts: 182
Hi I made a sample to see if I knew how to deploy an application in WAS. It consisted of two simple elements:
  • a Session Bean called Hello, with a print method that printed "Hello!" to the standard out and returned this string
  • a servlet that called the session bean and printed the result in the browser.

  • Inside WSAD it ran fine, but when I deployed it to WAS it gave the following error:
    this is the browser message:
    "Error 500: Failed to load target servlet [Test]"
    this is what I got from the log:
    Servlet Error-[Test]: Failed to load servlet: java.lang.NoClassDefFoundError: com/invenire/test/HelloHome
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:254)
    at java.beans.Beans.instantiate(Beans.java:213)
    at java.beans.Beans.instantiate(Beans.java:57)
    at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:148)
    at com.ibm.servlet.engine.webapp.WebAppServletManager.getServletReference(WebAppServletManager.java:287)
    at com.ibm.servlet.engine.webapp.WebApp.getServletReference(WebApp.java:354)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcherInfo.calculateInfo(WebAppRequestDispatcherInfo.java:130)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatcherInfo.<init>(WebAppRequestDispatcherInfo.java:46)
    at com.ibm.servlet.engine.webapp.WebApp.getRequestDispatcher(WebApp.java:1133)
    at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:118)
    at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
    at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
    at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
    at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
    at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

    Apparently, the server isn�t finding the class of the Home interface, although I don�t know why. If I remove from the servlet where it calls the EJB, the application runs fine and prints "Hello!", so the problem is not the servlet, the HTTP server, or the plugin configuration.
    I�m using the WAS 4 Test Environment inside WSAD 5 and my WAS is 4.0.1 Advanced Edition, can somebody help me? I really don�t know what�s happening. If anybody wants, I can show the source code, I didn�t put the code here because the message would be too long. Any help is deeply appreciated.
    [ April 08, 2003: Message edited by: Francisco A Guimaraes ]

    Francisco<br />SCJP<br />please use the [code][/code] tags when showing code.Click <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page" target="_blank" rel="nofollow">here</a> to see an example.
    Kyle Brown
    Ranch Hand

    Joined: Aug 10, 2001
    Posts: 3892
    This sounds like a classloader issue to me. Try adding the EJB-JAR file to the classpath in the manifest of the WAR file.

    Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
    See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
    Francisco A Guimaraes
    Ranch Hand

    Joined: Mar 20, 2002
    Posts: 182
    That was exactly the problem. Thanks very much.
    I agree. Here's the link: http://aspose.com/file-tools
    subject: Application runs only inside WSAD
    It's not a secret anymore!