RE: References between Webapp and EJB
Hi! Isn't it java:comp/env/ejb/name of ejb where the ejb can be looked up? I remember some examples where /ejb was the sub-level for EJBs. And can you tell me about the names? I mean, I have an ejb-name written in ejb-jar.xml. Is this the definitive name for the component which I have to use everywhere? Or has the name of the remote interface to be referenced somewhere? I'm actually asking because I played a bit with these names bit never succeeded. Thanks much, Fabian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Mulder Sent: Saturday, April 08, 2006 5:44 PM To: user@geronimo.apache.org Subject: Re: References between Webapp and EJB Yes, you need an EJB Ref (or more likely an EJB Local Ref) in web.xml. If the WAR and EJB JAR are in the same EAR, then the ejb-link in the EJB ref should point to the ejb-name of the EJB and that should make it work. If the WAR and EJB JAR are separate, then you need a geronimo-web.xml with a matching ejb-ref or ejb-local-ref that resolves the reference to the EJB in the standalone EJB JAR. Once you have the EJB ref, the servlet can look up the EJB in JNDI at the location java:comp/env/(name of EJB ref) Thanks, Aaron On 4/8/06, Fabian Dankof [EMAIL PROTECTED] wrote: Hello! I'm trying to get a simple example thing to work that consists of an EJB and a webapp. Up to now I don't know exactly how references between webapps and ejbs are made. Additionally I don't know which files I actually need. I've got the following deployment descriptors: ejb-jar.xml: -- ?xml version=1.0 encoding=UTF-8? ejb-jar 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/ejb-jar_2_1.xsd; version=2.1 description![CDATA[StringMirrorEJB generated by eclipse wtp xdoclet extension.]]/description display-nameStringMirrorEJB/display-name enterprise-beans !-- Session Beans -- session id=Session_MyStringMirror description![CDATA[A session bean named MyStringMirror]]/description display-nameMyStringMirror/display-name ejb-nameMyStringMirror/ejb-name homefoo.MyStringMirrorHome/home remotefoo.MyStringMirror/remote local-homefoo.MyStringMirrorLocalHome/local-home localfoo.MyStringMirrorLocal/local ejb-classfoo.MyStringMirrorSession/ejb-class session-typeStateless/session-type transaction-typeContainer/transaction-type /session /enterprise-beans /ejb-jar -- Here is my question if i need an additional 'id' attribute in the ejb-jar tag and which value it should have. I already noticed that the value in the 'id' attribute is taken as 'Component Name' in Geronimo Console. Here is my web.xml: --- ?xml version=1.0 encoding=UTF-8? web-app id=web-app_1 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; version=2.4 display-nameSimpleEJBConsumer/display-name distributable/ servlet display-nameSimpleEJBConsumer/display-name servlet-nameSimpleEJBConsumer/servlet-name servlet-classfoo.SimpleEJBConsumer/servlet-class /servlet servlet-mapping servlet-nameSimpleEJBConsumer/servlet-name url-pattern/SimpleEJBConsumer/url-pattern /servlet-mapping /web-app --- Do i need an ejb-ref in the web.xml??? geronimo-web.xml: --- ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://geronimo.apache.org/xml/ns/j2ee/web-1.0; xmlns:nam=http://geronimo.apache.org/xml/ns/naming-1.0; xmlns:sec=http://geronimo.apache.org/xml/ns/security-1.1; xmlns:sys=http://geronimo.apache.org/xml/ns/deployment-1.0; configId=SimpleEJBConsumer/SimpleEJBConsumer context-root/SimpleEJBConsumer/context-root context-priority-classloaderfalse/context-priority-classloader nam:ejb-ref nam:ref-nameejb/MyStringMirror/nam:ref-name nam:target-namegeronimo.server:J2EEServer=geronimo,j2eeType=StatelessSessi onBean,name=MyStringMirror/nam:target-name /nam:ejb-ref /web-app --- I would be very glad if someone can just tell my what is needed, and what is not. Thanks, Fabian
Woody Huang is out of the office.
I will be out of the office starting 04/09/2006 and will not return until 04/17/2006. I will respond to your message when I return.
Re: Table database creation
There is an Ant task to generate a SQL script to create the underlying tables. The following snippet should get you started (note that you need to replace the various ${} with the relevant base location and version numbers): taskdef name=ddlExporter classname=org.openejb.deployment.ant.DDLExporterTask classpath pathelement location=${maven.repo.local}/openejb/jars/openejb-builder-${openejb_version}.jar/ pathelement location=${maven.repo.local}/tranql/jars/tranql-${tranql_version}.jar/ pathelement location=${maven.repo.local}/geronimo/jars/geronimo-kernel-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/jars/geronimo-deployment-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/jars/geronimo-common-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/jars/geronimo-j2ee-schema-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/jars/geronimo-service-builder-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/xmlbeans/jars/xbean-${xmlbeans_version}.jar/ pathelement location=${maven.repo.local}/stax/jars/stax-api-${stax_api_version}.jar/ /classpath /taskdef ddlExporter ejbJar=jar:${maven.build.dir}/openejb-cmp2-prefetch.jar openejbJar=jar:${maven.build.dir}/openejb-cmp2-prefetch.jar output=${maven.build.dir}/openejb-cmp2-prefetch.sql ddlCommandBuilder=org.tranql.ddl.DerbyDDLCommandBuilder type=drop-create-constraint classpath pathelement location=target/openejb-cmp2-prefetch.jar/ /classpath /ddlExporter Note that the ejbJar and openejbJar attributes of the ddlExporter task supports various notations: * ejbJar: location of the ejb-jar.xml file 1. you can specify a jar, e.g. jar:myEJBModule.jar, and the task will look for META-INF/ejb-jar.xml within it; 2. you can specify a jar within a jar (this can be useful if you have an EJB module within an EAR), e.g. jar:jar:myEARModule.ear!/myEJBModule.jar, and the task will look for META-INF/ejb-jar.xml within the nested jar; and 3. you can specify the location of a bare ejb-jar.xml file, e.g. META-INF/ejb-jar.xml. * openejbJar: location of the openejb-jar DD 1. same as ejbJar 1. above; 2. same as ejbJar 2. above; 3. same as ejbJar 3. above; 4. you can specify an openejb-jar nested within a bare geronimo-application.xml file, e.g. nested:META-INF/geronimo-application.xml!/0 (0 is the index of the nested openejb-jar DD; 0 is the first openejb-jar element defined within geronimo-application.xml); and 5. you can specify an openejb-jar nested within a geronimo-application file within an EAR module, e.g. nested:jar:myEARModule.ear!/0. Thanks, Gianny Aaron Mulder wrote: I believe there's a command-line or Maven tool to output the table create SQL, but we don't do it as part of the deployment process. Gianny would probably know the exact syntax. Thanks, Aaron On 4/8/06, Olivier Voutat [EMAIL PROTECTED] wrote: I saw that jBoss has the capability of creating a database tables based on the Entity Beans that are created inside the container. It is that possible in Geronimo too ? Best Regards, -- Olivier Jeanpierre Voutat Rua Praia de Muriú, 9188 Cep 59092-390 / Natal - RN Tel: (84) 3219-0427 Cel: (84) 9977-3917
Re: Can I hash my passwords
Thanks Aaron, I went through your reply and will check it out. Actually I am working on the second solution you said of not directly submitting to j_security_check. Now another problem I am facing is, I have made a hello world application in Java Studio Creator. Simple one page example which should ideally run even on tomacat with JSTL installed. I was not sure about JSTL being present in Geronimo so I downloaded and added it to the common libraries. When I try to run this example it gives this error. . . type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet execution threw an exception com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194) root cause java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:123) com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:311) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87) com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117) javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs. Will appreciate any help or guidance on this Regards, Rohit
Re: Can I hash my passwords
I'm not sure what you mean by added it to the common libraries, but you may want to just put JSTL and JSF together in your WEB-INF/lib. Thanks, Aaron On 4/9/06, Rohit Rai [EMAIL PROTECTED] wrote: Thanks Aaron, I went through your reply and will check it out. Actually I am working on the second solution you said of not directly submitting to j_security_check. Now another problem I am facing is, I have made a hello world application in Java Studio Creator. Simple one page example which should ideally run even on tomacat with JSTL installed. I was not sure about JSTL being present in Geronimo so I downloaded and added it to the common libraries. When I try to run this example it gives this error. . . type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet execution threw an exception com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194) root cause java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:123) com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:311) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87) com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117) javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs. Will appreciate any help or guidance on this Regards, Rohit
Re: Table database creation
Might want to add this to the docs wiki if it is not already there. --jason On Apr 9, 2006, at 3:34 AM, Gianny Damour wrote: There is an Ant task to generate a SQL script to create the underlying tables. The following snippet should get you started (note that you need to replace the various ${} with the relevant base location and version numbers): taskdef name=ddlExporter classname=org.openejb.deployment.ant.DDLExporterTask classpath pathelement location=${maven.repo.local}/openejb/ jars/openejb-builder-${openejb_version}.jar/ pathelement location=${maven.repo.local}/tranql/ jars/tranql-${tranql_version}.jar/ pathelement location=${maven.repo.local}/geronimo/ jars/geronimo-kernel-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/ jars/geronimo-deployment-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/ jars/geronimo-common-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/ jars/geronimo-j2ee-schema-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/geronimo/ jars/geronimo-service-builder-${geronimo_version}.jar/ pathelement location=${maven.repo.local}/xmlbeans/ jars/xbean-${xmlbeans_version}.jar/ pathelement location=${maven.repo.local}/stax/jars/ stax-api-${stax_api_version}.jar/ /classpath /taskdef ddlExporter ejbJar=jar:${maven.build.dir}/openejb-cmp2-prefetch.jar openejbJar=jar:${maven.build.dir}/openejb-cmp2- prefetch.jar output=${maven.build.dir}/openejb-cmp2-prefetch.sql ddlCommandBuilder=org.tranql.ddl.DerbyDDLCommandBuilder type=drop-create-constraint classpath pathelement location=target/openejb-cmp2- prefetch.jar/ /classpath /ddlExporter Note that the ejbJar and openejbJar attributes of the ddlExporter task supports various notations: * ejbJar: location of the ejb-jar.xml file 1. you can specify a jar, e.g. jar:myEJBModule.jar, and the task will look for META-INF/ejb-jar.xml within it; 2. you can specify a jar within a jar (this can be useful if you have an EJB module within an EAR), e.g. jar:jar:myEARModule.ear!/ myEJBModule.jar, and the task will look for META-INF/ejb-jar.xml within the nested jar; and 3. you can specify the location of a bare ejb-jar.xml file, e.g. META-INF/ejb-jar.xml. * openejbJar: location of the openejb-jar DD 1. same as ejbJar 1. above; 2. same as ejbJar 2. above; 3. same as ejbJar 3. above; 4. you can specify an openejb-jar nested within a bare geronimo- application.xml file, e.g. nested:META-INF/geronimo- application.xml!/0 (0 is the index of the nested openejb-jar DD; 0 is the first openejb-jar element defined within geronimo- application.xml); and 5. you can specify an openejb-jar nested within a geronimo- application file within an EAR module, e.g. nested:jar:myEARModule.ear!/0. Thanks, Gianny Aaron Mulder wrote: I believe there's a command-line or Maven tool to output the table create SQL, but we don't do it as part of the deployment process. Gianny would probably know the exact syntax. Thanks, Aaron On 4/8/06, Olivier Voutat [EMAIL PROTECTED] wrote: I saw that jBoss has the capability of creating a database tables based on the Entity Beans that are created inside the container. It is that possible in Geronimo too ? Best Regards, -- Olivier Jeanpierre Voutat Rua Praia de Muriú, 9188 Cep 59092-390 / Natal - RN Tel: (84) 3219-0427 Cel: (84) 9977-3917
Re: commons logging issue
Paul McMahan wrote: I'm not sure why deployment didn't fail in jetty, perhaps you would have seen a failure later on when you tried to access your servlets(?). Hi, I recall noticing a few days ago some jars missing from Geronimo/Jetty /repository when compared to Geronimo/Tomcat. Commons Logging was one, there was also one or two others missing. Can anyone pls confirm that? (I do not have access to my installation at this very moment) This could be the reason why it works on Geronimo/Jetty but not Geronimo/Tomcat. Regards, Guilherme ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
How to deploy a web application based on Struts 1.2, Spring 1.2 and Hibernate 3 on Geronimo 1.0?
I had a difficult time deploying my application to geronimo. I have documented what I did at http://johnmammen.blogspot.com/2006/04/how-to-deploy-web-application-based-on.html If you have any question,clarification on the post, you can post it here and will reply to it.
Re: How to deploy a web application based on Struts 1.2, Spring 1.2 and Hibernate 3 on Geronimo 1.0?
Hi John, I looked at your blog and I would like to see the entire deployment plan you are using, what kind of app you are trying to deploy and what problems you are having. There is a Spring integration in Geronimo article where you can find details on how to deploy in Geronimo each of the sample apps already provided by the framework. Most of the apps have been configured to use Geronimo's specific resources like the embedded DB. http://opensource.atlassian.com/confluence/oss/display/GERONIMO/Spring An article on Struts is already on the way and it should be out soon !!! As for Hibernate, there is a migration article that should give you all the ammo you need for mapping to your app. Even when the goal is migration, you will find details of Hibernate implementation in Geronimo, what is supported and what is not and workarounds for some of the features not yet supported. http://opensource.atlassian.com/confluence/oss/display/GERONIMO/JBoss+to+Geronimo+-+Hibernate+Migration Cheers! Hernan Mammen wrote: I had a difficult time deploying my application to geronimo. I have documented what I did at http://johnmammen.blogspot.com/2006/04/how-to-deploy-web-application-based-on.html If you have any question,clarification on the post, you can post it here and will reply to it.