From user-return-15471-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Thu Apr 21 12:04:02 2011 Return-Path: X-Original-To: apmail-geronimo-user-archive@www.apache.org Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C0D46280D for ; Thu, 21 Apr 2011 12:04:02 +0000 (UTC) Received: (qmail 77775 invoked by uid 500); 21 Apr 2011 12:04:02 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 77731 invoked by uid 500); 21 Apr 2011 12:04:01 -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 Delivered-To: moderator for user@geronimo.apache.org Received: (qmail 52637 invoked by uid 99); 21 Apr 2011 00:25:03 -0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Date: Wed, 20 Apr 2011 17:24:36 -0700 (PDT) From: joquetaire To: user@geronimo.apache.org Message-ID: <1303345475556-2844215.post@n3.nabble.com> Subject: EJB and Web tutorial 3.0 --> deplyment error MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit hi all, i've tried to run the tutorial on accessing EJB inWeb application but got the error while deploying the Web part the tutorial is located: https://cwiki.apache.org/GMOxDOC30/accessing-ejb-in-web-applications.html (Home > Apache Geronimo v3.0 > Documentation > Developing > Tutorials > Developing Web applications > Accessing EJB in Web applications) server seems to work fine - SDK, Eclipse, GEP, Geronimo server: Debian version: 2.22.3 $ java -version java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode) geronimo-jetty8-javaee6-3.0-M1 eclipse-jee-helios-SR2-linux-gtk Eclipse Java EE IDE for Web Developers. Version: Helios Service Release 2 Build id: 20110218-0911 Apache Geronimo v3.0 Server Adapter Version: 3.0.0-20100706214934 all files in 2 projects of the tutorial are presented below (tried to follow the tutorial 'a la lettre') --> Converter.java package ejb; import java.math.BigDecimal; import javax.ejb.Remote; @Remote public interface Converter { public BigDecimal dollarToRupees(BigDecimal dollars); public BigDecimal rupeesToEuro(BigDecimal rupees); } --> ConverterBean.java package ejb; import java.math.BigDecimal; import javax.ejb.*; @Stateless public class ConverterBean implements Converter { private BigDecimal rupeeRate = new BigDecimal("40.58"); private BigDecimal euroRate = new BigDecimal("0.018368"); public BigDecimal dollarToRupees(BigDecimal dollars) { BigDecimal result = dollars.multiply(rupeeRate); return result.setScale(2, BigDecimal.ROUND_UP); } public BigDecimal rupeesToEuro(BigDecimal rupees) { BigDecimal result = rupees.multiply(euroRate); return result.setScale(2, BigDecimal.ROUND_UP); } } --> ejb-jar.xml CurrencyConvertEJB --> openejb-jar.xml default CurrencyConverterEJB 1.0 car --> index.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Converter Converter

Enter an amount to convert:


--> ConverterHandler.java package webejb; import java.io.IOException; import java.io.PrintWriter; import java.math.BigDecimal; import javax.ejb.EJB; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import ejb.Converter; /** * Servlet implementation class ConverterHandler */ @WebServlet("/ConverterHandler") public class ConverterHandler extends HttpServlet { private static final long serialVersionUID = 1L; @EJB(name = "ejb/Converter") private Converter converter; /** * @see HttpServlet#HttpServlet() */ public ConverterHandler() { super(); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); String amount = request.getParameter("amount"); if (amount != null && amount.length() > 0) { BigDecimal d = new BigDecimal(amount); BigDecimal rupeeAmount = converter.dollarToRupees(d); out.println("

" + amount + " Dollars are " + rupeeAmount + " Rupees.

"); BigDecimal euroAmount = converter.rupeesToEuro(rupeeAmount); out.println(amount + " Dollars are " + euroAmount + " Euro."); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } } --> web.xml WebEJB index.html index.htm index.jsp default.html default.htm default.jsp --> geronimo-web.xml default WebEJB 1.0 car default CurrencyConvertEJB 1.0 car /WebEJB ejb/Converter default CurrencyConvertEJB 1.0 ConverterBean --> Error Message Box 'Publishing to Apache Geronimo v3.0 Server at localhost...' has encouterred a problem. NLS missing message: DISTRIBUTE_FAIL in: org.apache.geronimo.st.v30.core.internal.Messages Classloader for nullcan't find Could not fully load class: webejb.ConverterHandler due to:Lejb/Converter; in classLoader: 412.0 org.apache.geronimo.common.DeploymentException: Classloader for nullcan't find Could not fully load class: webejb.ConverterHandler due to:Lejb/Converter; in classLoader: 412.0 at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:678) at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:623) at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:700) at org.apache.geronimo.jetty8.deployment.JettyModuleBuilder.addGBeans(JettyModuleBuilder.java:482) at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:175) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:690) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:250) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:138) at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:856) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245) at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:344) at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:856) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245) at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.access$200(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source) at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) at sun.rmi.transport.Transport$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Unknown Source) at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: Could not fully load class: webejb.ConverterHandler due to:Lejb/Converter; in classLoader: 412.0 at org.apache.xbean.finder.ClassFinder.(ClassFinder.java:161) at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:676) ... 44 more --> Console 2011-04-21 01:54:36,567 ERROR [DependencyManager] Could not install bundle dependecy org.osgi.framework.BundleException: Unable to cache bundle: mvn:default/CurrencyConvertEJB/1.0/car at org.apache.felix.framework.Felix.installBundle(Felix.java:2378) at org.apache.felix.framework.Felix.installBundle(Felix.java:2334) at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:130) at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:108) at org.apache.geronimo.system.configuration.DependencyManager.starting(DependencyManager.java:182) at org.apache.geronimo.system.configuration.DependencyManager.bundleChanged(DependencyManager.java:89) at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:800) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:728) at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3612) at org.apache.felix.framework.Felix.activateBundle(Felix.java:1750) at org.apache.felix.framework.Felix.startBundle(Felix.java:1682) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905) at org.apache.geronimo.deployment.DeploymentContext.createTempConfiguration(DeploymentContext.java:202) at org.apache.geronimo.deployment.DeploymentContext.initializeConfiguration(DeploymentContext.java:188) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:606) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:250) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:138) at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:856) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245) at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:344) at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:856) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245) at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.access$200(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source) at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) at sun.rmi.transport.Transport$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Unknown Source) at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.RuntimeException: URL [mvn:default/CurrencyConvertEJB/1.0/car] could not be resolved. at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:195) at org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:487) at org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:163) at org.apache.felix.framework.cache.JarRevision.(JarRevision.java:80) at org.apache.felix.framework.cache.JarRevision.(JarRevision.java:58) at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:1020) at org.apache.felix.framework.cache.BundleArchive.revise(BundleArchive.java:631) at org.apache.felix.framework.cache.BundleArchive.(BundleArchive.java:147) at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:169) at org.apache.felix.framework.Felix.installBundle(Felix.java:2374) ... 54 more --> Servers +-> Apache Geronimo v3.0 Server at localhost [Started, Republish] +--> CurrencyCOnverterEJB [SYnchronized] +--> WebEJB [Error publishing module to server] --> http://localhost:8080/console/ Web App WArs Component Name Display Name URL State Commands org.apache.geronimo.configs/dojo-jetty/3.0-M1/car Dojo Webapp /dojo running Stop Stop Restart Restart Uninstall Uninstall org.apache.geronimo.configs/remote-deploy-jetty/3.0-M1/car Geronimo Remote Deployer /remote-deploy running Stop Stop Restart Restart Uninstall Uninstall org.apache.geronimo.configs/welcome-jetty/3.0-M1/car Welcome to Geronimo / running Stop Stop Restart Restart Uninstall Uninstall org.apache.geronimo.plugins/plugin-console-jetty/3.0-M1/car Geronimo Management Console Portlets /plugin running Stop Restart Uninstall Application EARs Component Name URL State Commands org.apache.geronimo.plugins/console-jetty/3.0-M1/car running Stop Restart Uninstall EJB JARs Component Name State Commands default/CurrencyConverterEJB/1.0/car running Stop Restart Uninstall so... the question is: what do i miss here? joquetaire -- View this message in context: http://apache-geronimo.328035.n3.nabble.com/EJB-and-Web-tutorial-3-0-deplyment-error-tp2844215p2844215.html Sent from the Users mailing list archive at Nabble.com.