Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » My First web Application & EJB
My First web Application & EJB [message #229921] Thu, 02 April 2009 04:46
devang is currently offline devang
Messages: 2
Registered: July 2009
Junior Member
Hello everybody just working in a web application with Eclipse today I
tried to replicate the example shown here:
http://live.eclipse.org/node/572 with Java EE v2.1 Glassfish application
server but does not work.
I do not know if I failed to configure something in Eclipse.
(I can only say that the voice in project explore my Web-Application):

CiaoWeb-> References is empty.
While the tutorial is the entire path to get to the servlet.
in my case should be
ciao.prj.CiaoServlet/Hello

There the EJB project:


// Hello.java
package mio.prj;
import javax.ejb.Local;

@Local
public interface Hello {
	public String sayHello(String s);
}



//HelloBean

package mio.prj;

import javax.ejb.Stateless;

/**
 * Session Bean implementation class HelloBean
 */
@Stateless
public class HelloBean implements Hello {

    /**
     * Default constructor. 
     */
    public HelloBean() {
        // TODO Auto-generated constructor stub
    }

	@Override
	public String sayHello(String s) {
		// TODO Auto-generated method stub
		return "Ciao "+s+" !!!";
	}

}


there a webApplication with servlet CiaoServlet;

package mio.prj;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class CiaoServlet
 */
public class CiaoServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	Hello h;
    /**
     * @see HttpServlet#HttpServlet()
     */
    public CiaoServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse 
response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
		String name=request.getParameter("name");
		response.getOutputStream().println(h.sayHello(name));
	}

}




there GlassFish v2.1 log:

INFO: classLoader = WebappClassLoader
  delegate: true
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
EJBClassLoader : 
urlSet = []
doneCalled = false 
 Parent -> java.net.URLClassLoader@1a2f02e

INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@554acb

GRAVE: Class [ Lmio/prj/Hello; ] not found. Error while loading [ class 
mio.prj.CiaoServlet ]
AVVERTENZA: Error in annotation processing: 
java.lang.NoClassDefFoundError: Lmio/prj/Hello;
INFO: deployed with moduleid = CiaoWeb

GRAVE: StandardWrapperValve[Ciao]: PWC1406: Servlet.service() for servlet 
Ciao threw exception
java.lang.NoClassDefFoundError: mio/prj/Hello
	at mio.prj.CiaoServlet.doGet(CiaoServlet.java:29)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	at 
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
	at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
	at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
	at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
	at 
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
	at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
	at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
	at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
	at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
	at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
	at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
	at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
	at 
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
	at 
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
	at 
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
	at 
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
	at 
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
	at 
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.ClassNotFoundException: mio.prj.Hello
	at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1576)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	... 31 more



help-me .....
Previous Topic:ATTN: Konstantin - FlexibleProjectContainer.java changes from 1.34 to 1.36
Next Topic:Question regarding bug240698.
Goto Forum:
  


Current Time: Mon Jul 28 02:30:20 EDT 2014

Powered by FUDForum. Page generated in 0.01458 seconds