From user-return-5122-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Fri Oct 27 08:49:26 2006 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 26267 invoked from network); 27 Oct 2006 08:49:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2006 08:49:25 -0000 Received: (qmail 22027 invoked by uid 500); 27 Oct 2006 08:49:34 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 22006 invoked by uid 500); 27 Oct 2006 08:49:34 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 21992 invoked by uid 99); 27 Oct 2006 08:49:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 01:49:34 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of hubertb@hab-verschlafen.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 27 Oct 2006 01:49:22 -0700 Received: (qmail invoked by alias); 27 Oct 2006 08:48:59 -0000 Received: from office.dieitexperten.de (EHLO titanium.dieitexperten.de) [87.139.35.149] by mail.gmx.net (mp033) with SMTP; 27 Oct 2006 10:48:59 +0200 X-Authenticated: #3175359 Subject: Re: Eclipse + Geronimo + EJB = NullPointerException? From: HubertB To: user@geronimo.apache.org In-Reply-To: <4540A6CD.107@opensource.lk> References: <1161858187.18455.21.camel@localhost> <45409917.5060006@opensource.lk> <1161862946.21158.1.camel@localhost> <4540A6CD.107@opensource.lk> Content-Type: text/plain Date: Fri, 27 Oct 2006 10:49:28 +0200 Message-Id: <1161938968.4925.15.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org OK, now my web.xml looks like this: ZooWeb index.html index.htm index.jsp default.html default.htm default.jsp ejb/Tiger Session com.zoo.TigerLocalHome com.zoo.TigerLocal Tiger I updated the test.jsp to use the LocalHome: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="javax.naming.*"%> <%@page import="com.zoo.*"%> Insert title here <% Context ctx = new InitialContext(); TigerLocalHome tlh = (TigerLocalHome) ctx.lookup("java:comp/env/ejb/Tiger"); TigerLocal tl = tlh.create(); tl.foo("Test!"); %> Now I am getting this error: Unable to compile class for JSP An error occurred at line: 12 in the jsp file: /test.jsp Generated servlet error: The method foo(String) is undefined for the type TigerLocal So I chanced the XDoclet-Tag in TigerBean.java from "remote" to "both": /** * * * @ejb.interface-method view-type="both" * * @generated * * //TODO: Must provide implementation for bean method stub */ public String foo(String param) { return null; } But I am still getting the "method is undefinded" error. Whats wrong now? Am Donnerstag, den 26.10.2006, 17:45 +0530 schrieb Lasantha Ranaweera: > There must be a tag like given in the web.xml if your EJB is locally > referred one. > > > > ejb/BankManagerFacade > Session > org.apache.geronimo.samples.bank.ejb.BankManagerFacadeHomeLocal > org.apache.geronimo.samples.bank.ejb.BankManagerFacadeLocal > BankManagerFacadeBean > > If still have problem please post your TigerUtil.java, ejb-jar.xml and > openejb-jar.xml files. > > Have a look at : > http://cwiki.apache.org/GMOxDOC11/ejb-sample-application.html > > Thanks, > Lasantha Ranaweera > HubertB wrote: > > Hi! > > > > > > > > The web.xml looks like this: > > > > > > > xmlns="http://java.sun.com/xml/ns/j2ee" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> > > > > ZooWeb > > > > index.html > > index.htm > > index.jsp > > default.html > > default.htm > > default.jsp > > > > > > > > > > > > This is the content of geronimo-web.xml: > > > > > > > xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1" > > xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" > > xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"> > > > > > > default > > ZooWeb > > 1.0 > > car > > > > > > /ZooWeb > > > > > > Am Donnerstag, den 26.10.2006, 16:46 +0530 schrieb Lasantha Ranaweera: > > > > > Hi Hurbert, > > > > > > Can you post geronimo-web.xml file and web.xml files? I think you can > > > find those files from your project. > > > > > > Thanks, > > > Lasantha Ranaweera > > > HubertB wrote: > > > > > > > Hi! > > > > > > > > I need a bit help getting this EJB-Tutorial to run on Geronimo 1.1: > > > > http://www.eclipse.org/webtools/community/tutorials/ejbtutorial/buildingejbs.html > > > > > > > > I am using Eclipse 3.2.1 with WTP 1.5.1, JEM 1.2.1, EMF 2.1, GEF 3.2.1, > > > > Geronimo-Plugin 1.1 (from this file: > > > > g-eclipse-plugin-1.1-v200610161117-deployable) and XDoclet 1.2.3. > > > > > > > > > > > > This is what I have done: > > > > > > > > 1. Create a J2EE => Enterprise Application Project and name it > > > > "ZooBeansProject" > > > > 2. Create a EJB => EJB Project, name it "ZooBeans", check "Add project > > > > to an EAR" and choose "ZooBeansProject" > > > > 3. In "ZooBeans" I created a new EJB => XDoclet Enterprise JavaBean, > > > > Type = Session Bean, Package = com.zoo, name = "TigerBean" > > > > 4. Rightclick on "Apache Geronimo v1.1 Server @ localhost", choose "Add > > > > and Remove Projects..." and add "ZooBeansProject" > > > > 5. Started Geronimo and noticed that ZooBeansProject has been deployed > > > > to the server > > > > 6. Created a Web => Dynamic Web Project named "ZooWeb", also checked > > > > "Add project to an EAR" and chose "ZooBeansProject" > > > > 7. In "ZooWeb", I created "test.jsp" containing the following code: > > > > > > > > <%@ page language="java" contentType="text/html; charset=UTF-8" > > > > pageEncoding="UTF-8"%> > > > > > > > "http://www.w3.org/TR/html4/loose.dtd"> > > > > > > > > > > > > > > > > Insert title here > > > > > > > > > > > > <% > > > > com.zoo.Tiger tiger = null; > > > > try { > > > > com.zoo.TigerHome home = com.zoo.TigerUtil.getHome(); > > > > tiger = home.create(); > > > > } catch(Exception exception) { > > > > } > > > > %> > > > > <%= tiger.foo("Test") %> > > > > > > > > > > > > > > > > 8. Rightclick on "test.jsp", select "Run As" => "Run on Server" then I > > > > get this error: > > > > > > > > 12:13:56,670 ERROR [[jsp]] Servlet.service() for servlet jsp threw > > > > exception > > > > java.lang.NullPointerException > > > > at org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:60) > > > > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:688) > > > > at > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) > > > > at > > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) > > > > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) > > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:688) > > > > at > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > > > > at > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > > > > at > > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > > > > at > > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > > > > at > > > > org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56) > > > > at org.apache.geronimo.tomcat.GeronimoStandardContext > > > > $SystemMethodValve.invoke(GeronimoStandardContext.java:342) > > > > at > > > > org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:31) > > > > at > > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > > > > at > > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > > > > at > > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > > > > at > > > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) > > > > at > > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > > > > at > > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) > > > > at org.apache.coyote.http11.Http11BaseProtocol > > > > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) > > > > at > > > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) > > > > at > > > > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) > > > > at org.apache.tomcat.util.threads.ThreadPool > > > > $ControlRunnable.run(ThreadPool.java:684) > > > > at java.lang.Thread.run(Thread.java:595) > > > > > > > > Whats wrong here? > > > > > > > > > > > > > > > > > > > > > > >