Hi David, and hi all,
this is the openejb.log, start tomcat:
INFO :
*******************************************************************
*************
OpenEJB http://www.openejb.org
Startup: 17/11/06 22.57
Copyright 1999-2004 (C) OpenEJB Project, All Rights Reserved.
Version: 1.0
Build date: 20060226
Build time: 1701
*******************************************************************
*************
INFO : openejb.home = C:\Programmi\openejb-1.0
INFO : openejb.base = C:\Programmi\openejb-1.0
DEBUG: Instantiating assembler class
org.openejb.alt.assembler.classic.Assembler
WARN : Cannot find the configuration file [null], Trying conf/
openejb.conf instead.
INFO : Loaded EJBs from C:\Programmi\openejb-1.0\beans\openejb-
itests-beans.jar
INFO : Loaded EJBs from C:\Programmi\openejb-1.0\beans\openejb-
webadmin-clienttools.jar
INFO : Loaded EJBs from C:\Programmi\openejb-1.0\beans\openejb-
webadmin-ejbgen.jar
INFO : Loaded EJBs from C:\Programmi\openejb-1.0\beans\openejb-
webadmin-main.jar
WARN : Reading openejb-jar.xml.
org.openejb.OpenEJBException: Cannot find the openejb-jar.xml in
C:\Programmi\openejb-1.0\beans\myHelloEjb.jar.
at org.openejb.alt.config.Unmarshaller.unmarshalFromJar
(Unmarshaller.java:101)
at org.openejb.alt.config.Unmarshaller.unmarshal
(Unmarshaller.java:90)
at org.openejb.alt.config.Unmarshaller.unmarshal
(Unmarshaller.java:82)
at org.openejb.alt.config.EjbJarUtils.readOpenEjbJar
(EjbJarUtils.java:112)
at org.openejb.alt.config.EjbJarUtils.<init>(EjbJarUtils.java:
97)
at org.openejb.alt.config.ConfigurationFactory.loadDeployments
(ConfigurationFactory.java:1210)
at
org.openejb.alt.config.ConfigurationFactory.getOpenEjbConfiguration
(ConfigurationFactory.java:201)
at org.openejb.alt.assembler.classic.Assembler.init
(Assembler.java:132)
at org.openejb.OpenEJB.init(OpenEJB.java:236)
at org.openejb.tomcat.TomcatLoader.init(TomcatLoader.java:88)
at org.openejb.tomcat.TomcatLoader.init(TomcatLoader.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.openejb.loader.LoaderServlet$LoaderWrapper.init
(LoaderServlet.java:171)
at org.openejb.loader.LoaderServlet.init(LoaderServlet.java:98)
at org.apache.catalina.core.StandardWrapper.loadServlet
(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load
(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup
(StandardContext.java:3951)
at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4225)
at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild
(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild
(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployWAR
(HostConfig.java:809)
at org.apache.catalina.startup.HostConfig.deployWARs
(HostConfig.java:698)
at org.apache.catalina.startup.HostConfig.deployApps
(HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.start
(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:310)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start
(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start
(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start
(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start
(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start
(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start
(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:
294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:
432)
INFO : Loaded EJBs from C:\Programmi\openejb-1.0\beans
\myHelloEjb.jar
INFO : Loaded EJBs from C:\Programmi\openejb-1.0\beans\CiaoWS.jar
DEBUG: Containers : 4
DEBUG: Type Container ID
DEBUG: ENTITY Default BMP Container
DEBUG: ENTITY Default CMP Container
DEBUG: STATEFUL Default Stateful Container
DEBUG: STATELESS Default Stateless Container
DEBUG: Deployments : 38
DEBUG: Type Deployment ID
DEBUG: STATEFUL client/tests/stateful/EncBean
DEBUG: CMP_ENTITY client/tests/entity/cmp/RMI-over-IIOP/
EJBHome
DEBUG: STATEFUL client/tests/stateful/BasicStatefulHome
DEBUG: STATELESS ClientTools/ViewClass
DEBUG: STATELESS Webadmin/Configuration
DEBUG: STATELESS EJBGenerator/CreateEJB
DEBUG: STATELESS Hello
DEBUG: STATELESS ClientTools/InvokeObject
DEBUG: STATELESS Webadmin/Properties
DEBUG: STATELESS CiaoWS
DEBUG: STATEFUL client/tests/stateful/RMI-over-IIOP/EJBHome
DEBUG: STATELESS Webadmin/Home
DEBUG: BMP_ENTITY client/tests/entity/bmp/
allowed_operations/EntityHome
DEBUG: CMP_ENTITY client/tests/entity/cmp/EncBean
DEBUG: STATELESS httpd/DefaultBean
DEBUG: STATEFUL client/tests/stateful/
BeanManagedBasicStatefulHome
DEBUG: STATELESS client/tools/DatabaseHome
DEBUG: BMP_ENTITY client/tests/entity/bmp/EncBean
DEBUG: STATEFUL config/webadmin/ConfigurationData
DEBUG: STATEFUL deploy/webadmin/Deployer
DEBUG: STATELESS ClientTools/ViewJndi
DEBUG: STATELESS Webadmin/DeploymentList
DEBUG: STATELESS client/tests/stateless/
BeanManagedBasicStatelessHome
DEBUG: STATELESS Webadmin/CMPMapping
DEBUG: STATELESS client/tests/stateless/EncBean
DEBUG: STATEFUL client/tests/stateful/
BeanManagedTransactionTests/EJBHome
DEBUG: BMP_ENTITY client/tests/entity/bmp/RMI-over-IIOP/
EJBHome
DEBUG: STATELESS Webadmin/ListLogs
DEBUG: STATELESS client/tests/stateless/
BeanManagedTransactionTests/EJBHome
DEBUG: STATELESS ClientTools/ViewEjb
DEBUG: BMP_ENTITY client/tests/entity/bmp/BasicBmpHome
DEBUG: STATEFUL mapping/webadmin/CMPMappingData
DEBUG: STATELESS client/tests/stateless/BasicStatelessHome
DEBUG: CMP_ENTITY client/tests/entity/cmp/BasicCmpHome
DEBUG: STATELESS Webadmin/Deployment
DEBUG: STATEFUL httpd/session
DEBUG: CMP_ENTITY client/tests/entity/cmp/
allowed_operations/EntityHome
DEBUG: STATELESS client/tests/stateless/RMI-over-IIOP/EJBHome
DEBUG: SecurityService : org.openejb.ri.sp.PseudoSecurityService
DEBUG: TransactionManager:
org.openejb.core.TransactionManagerWrapper
INFO : OpenEJB ready.
Thanks,
Francesco
David Blevins ha scritto:
Hi Francesco,
Couple quick things, could you post your openejb.log file?
That'd help us figure out what might have happened to your
bean, etc. Or what name should be used to look it up.
Thanks,
David
On Nov 17, 2006, at 1:12 PM, Francesco Sessa wrote:
Hi all,
I'm an italian university student.
Sorry for my english.
I have installed openejb 1.0 on my pc, and i copy the war
loader in the webapps directory of my tomcat 5.5 server.
I have modified the xml file in the war (openejb.home).
I have deployed myHelloEjb.jar (openejb deploy -c -f -a C:/
myHelloEjb.jar) (ID= Hello Container=1 (the only one).
I create a jsp, openejb.jsp, in webapps/examples, and i create
the WEB-INF/web.xml. I post the code of the openejb.jsp, and
the code of web.xml:
openejb.jsp:
<%@ page import="org.acme.HelloObject,
org.acme.HelloHome,
javax.naming.InitialContext,
javax.naming.Context,
java.util.*"%>
<html>
<head>
<title>OpenEJB -- EJB for Tomcat</title>
</head>
<body>
Stateless Session bean - HelloBean - says:
<%
Properties p = new Properties();
p.put("java.naming.factory.initial",
"org.openejb.client.LocalInitialContextFactory");
Context initCtx = new InitialContext();
Object object = initCtx.lookup("java:comp/env/ejb/hello");
//Object object = initCtx.lookup("Hello");
HelloHome helloHome = (HelloHome)
javax.rmi.PortableRemoteObject.narrow(object,
HelloHome.class);
HelloObject bean = helloHome.create();
%>
<%= bean.sayHello() %>
</body>
</html>
web.xml:
<ejb-ref>
<description> EJB Reference to the bean deployed to
OpenEJB </description>
<ejb-ref-name>ejb/hello</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>org.acme.HelloHome</home>
<remote>org.acme.Hello</remote>
</ejb-ref>
I insert in %CATALINA_HOME%/conf/server.xml the code:
<Context path="/examples">
<Ejb name="ejb/hello" type="Session"
home="org.acme.HelloHome" remote="org.acme.Hello"/>
<ResourceParams name="ejb/hello">
<parameter>
<name>factory</name>
<value>org.openejb.client.TomcatEjbFactory</value>
</parameter>
<parameter>
<name>openejb.naming.factory.initial</name>
<value>org.openejb.client.LocalInitialContextFactory</value>
</parameter>
<parameter>
<name>openejb.ejb-link</name>
<value>Hello</value>
</parameter>
</ResourceParams>
</Context>
in the "Host" xml-node.
When i launch tomcat, and i go at http://localhost:8080/
examples/openejb.jsp i read the error report:
HTTP Status 500 -
-----------------------------------------------------------------
-------
*type* Exception report
*message*
*description* _The server encountered an internal error ()
that prevented it from fulfilling this request._
*exception*
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.handleJspException
(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
*root cause*
java.lang.NullPointerException
org.openejb.core.ivm.naming.IvmContext.lookup
(IvmContext.java:152)
javax.naming.InitialContext.lookup(InitialContext.java:351)
org.apache.jsp.openejb_jsp._jspService(openejb_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
*note* _The full stack trace of the root cause is available in
the Apache Tomcat/5.5.20 logs._
-----------------------------------------------------------------
-------
Apache Tomcat/5.5.20
If i modify openejb.jsp code in:
Properties p = new Properties();
p.put("java.naming.factory.initial",
"org.openejb.client.LocalInitialContextFactory");
Context initCtx = new InitialContext(p);
//Object object = initCtx.lookup("java:comp/env/ejb/hello");
Object object = initCtx.lookup("Hello");
HelloHome helloHome = (HelloHome)
javax.rmi.PortableRemoteObject.narrow(object,
HelloHome.class);
HelloObject bean = helloHome.create();
I want to hide in the jsp the openejb factory.
Can you help me please?
I'm in a hurry, because this examples it's important for my
graduation thesis.
Thank you