Re: [JBoss-user] help with bounding entity bean
If you deployed the directory shown I'm surprised anything at all deployed. You need to package ejbs separately from jsp/servlets. If you want one deployment unit use and .ear david jencks On 2003.02.26 07:33 costin wrote: Hi! I know that there are responses on the list for this kind of problem but there is no archive...yet. I am new to JBoss after moving from Resin EE and I am trying to get the hand of it - especially in the deployment area. I have read a lot of tutorials based on ant (includind the official doc) but I can`t make the entity bean bound. I have been banging my head agains the wall for the last day and it`s starting to hurt really bad so any help will be greatly appreciated. Okay, before giving the details here is the behaviour: the war is deployed okay and I can see the index.html page. The bean classes are very simple - I have listed them at the end of the message. The problem is that when I am accessing the jsp I cannot get the entity bean reference: snip from the log - the extra logging is from the jsp 14:11:10,217 INFO [jbossweb] Started WebApplicationContext[/bs,file:/usr/local/jboss-3.0.6/server/default/deploy/bs.war/] 14:11:10,394 INFO [jbossweb] successfully deployed file:/usr/local/jboss-3.0.6/server/default/deploy/bs.war/ to /bs 14:11:10,394 INFO [MainDeployer] Deployed package: file:/usr/local/jboss-3.0.6/server/default/deploy/bs.war/ 14:11:31,375 INFO [jbossweb] Registered jboss.web:Jetty=0,HttpContext=0,context=/ 14:11:31,389 INFO [jbossweb] Registered jboss.web:Jetty=0,HttpContext=0,context=/,RootNotFoundHandler=0 14:11:31,390 INFO [jbossweb] Started HttpContext[/] 14:11:44,567 INFO [jbossweb] Got context 14:11:44,644 WARN [jbossweb] WARNING: Naming Exception 1046261504621 javax.naming.NameNotFoundException: HandlerBean not bound at org.apache.jsp.test$jsp.jspInit(test$jsp.java:52) at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:90) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspServlet.java:142) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:178) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:280) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:553) at org.mortbay.http.HttpContext.handle(HttpContext.java:1717) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:549) at org.mortbay.http.HttpContext.handle(HttpContext.java:1667) at org.mortbay.http.HttpServer.service(HttpServer.java:862) at org.jboss.jetty.Jetty.service(Jetty.java:497) at org.mortbay.http.HttpConnection.service(HttpConnection.java:759) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:923) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:776) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:202) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455) 14:11:44,645 INFO [jbossweb] Naming Exception 1046261504621: javax.naming.NameNotFoundException: HandlerBean not bound /snip Here`s is my configuration: jboss-3.0.6 on RH 7.3 $ java -version java version 1.4.1_01 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01) Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode) I have configured jboss with mysql using the samples xml and here goes the application. I have a very light entity bean that is being called by a jsp. The directory structure is: $ tree bs bs |-- META-INF | |-- ejb-jar.xml | `-- jbosscmp-jdbc.xml |-- WEB-INF | `-- web.xml |-- index.html |-- test | |-- Handler.class | |-- HandlerBean.class | `-- HandlerHome.class `-- test.jsp 3 directories, 8 files I have symlinked the directory to $JBOSS_HOME/server/default/deploy/bs.war The sources are as follow: test.jsp %@ page import=javax.ejb.*,javax.naming.*,test.*, java.util.* % html %! HandlerHome home; public void jspInit() { try { // Get a naming context InitialContext initial = new InitialContext(); getServletContext().log(Got context);
RE: [JBoss-user] help with bounding entity bean
First of the names of the beans should match in your ejb-jar.xml (HandlerBean) and jbosscmp-jdbc.xml (you have TestBean) Second of all I am not sure if you can deploy your app in a single war. My suspision is that you would nedd to break it up on war [put your web stuff in here] and ejb.jar [put your ejbs in here] then merge them together into ear. Basically the structure should look something like the following: your-ejb.jar test/ YourEjb.class META-INF/ jbosscmp-jdbc.xml jboss.xml ejb-jar.xml your-app.war index.jsp WEB-INF/ web.xml jbossweb.xml lib/ ejb-client.jar app.ear your-app.war your-ejb.jar MEAT-INF/ application.xml and you only copy app.ear into deploy directory you basically have anywhere from 3 to 6 xml descriptors to figure out :-) ejb-jar.xml [required] web.xml [required] application.xml [required] jbosscmp-jdbc.xml [optional] jboss.xml [optional] jbossweb.xml [optional] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of costin Sent: Wednesday, February 26, 2003 7:33 AM To: [EMAIL PROTECTED] Subject: [JBoss-user] help with bounding entity bean Hi! I know that there are responses on the list for this kind of problem but there is no archive...yet. I am new to JBoss after moving from Resin EE and I am trying to get the hand of it - especially in the deployment area. I have read a lot of tutorials based on ant (includind the official doc) but I can`t make the entity bean bound. I have been banging my head agains the wall for the last day and it`s starting to hurt really bad so any help will be greatly appreciated. Okay, before giving the details here is the behaviour: the war is deployed okay and I can see the index.html page. The bean classes are very simple - I have listed them at the end of the message. The problem is that when I am accessing the jsp I cannot get the entity bean reference: snip from the log - the extra logging is from the jsp 14:11:10,217 INFO [jbossweb] Started WebApplicationContext[/bs,file:/usr/local/jboss-3.0.6/server/defau lt/deploy/bs.war/] 14:11:10,394 INFO [jbossweb] successfully deployed file:/usr/local/jboss-3.0.6/server/default/deploy/bs.war/ to /bs 14:11:10,394 INFO [MainDeployer] Deployed package: file:/usr/local/jboss-3.0.6/server/default/deploy/bs.war/ 14:11:31,375 INFO [jbossweb] Registered jboss.web:Jetty=0,HttpContext=0,context=/ 14:11:31,389 INFO [jbossweb] Registered jboss.web:Jetty=0,HttpContext=0,context=/,RootNotFoundHandler=0 14:11:31,390 INFO [jbossweb] Started HttpContext[/] 14:11:44,567 INFO [jbossweb] Got context 14:11:44,644 WARN [jbossweb] WARNING: Naming Exception 1046261504621 javax.naming.NameNotFoundException: HandlerBean not bound at org.apache.jsp.test$jsp.jspInit(test$jsp.java:52) at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:90) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspSer vlet.java:142) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNeces sary(JspServlet.java:178) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp Servlet.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplic ationHandler.java:280) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:553) at org.mortbay.http.HttpContext.handle(HttpContext.java:1717) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicat ionContext.java:549) at org.mortbay.http.HttpContext.handle(HttpContext.java:1667) at org.mortbay.http.HttpServer.service(HttpServer.java:862) at org.jboss.jetty.Jetty.service(Jetty.java:497) at org.mortbay.http.HttpConnection.service(HttpConnection.java:759) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:923) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:776) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:202) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455) 14:11:44,645 INFO [jbossweb] Naming Exception 1046261504621: javax.naming.NameNotFoundException: HandlerBean not bound /snip Here`s is my configuration: jboss-3.0.6 on RH 7.3 $ java -version java version 1.4.1_01 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01) Java HotSpot(TM) Client VM (build
Re: Re: [JBoss-user] help with bounding entity bean
Hello! If you deployed the directory shown I'm surprised anything at all deployed. You need to package ejbs separately from jsp/servlets. If you want one deployment unit use and .ear david jencks Maybe I am missing something here but I am using hot deployment. I don`t pack/jar or archive in away the files. Is there a different strucure I need to use when hot-deploying...? -- costin --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: Re: [JBoss-user] help with bounding entity bean
nope you just drop the ear and it will be deployed or just copy the directory with the structure of the archive and name it in a way that that will end with .ear The main point is taht you need to deploy your ejb and war in separate pieces -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of costin Sent: Wednesday, February 26, 2003 8:32 AM To: [EMAIL PROTECTED] Subject: Re: Re: [JBoss-user] help with bounding entity bean Hello! If you deployed the directory shown I'm surprised anything at all deployed. You need to package ejbs separately from jsp/servlets. If you want one deployment unit use and .ear david jencks Maybe I am missing something here but I am using hot deployment. I don`t pack/jar or archive in away the files. Is there a different strucure I need to use when hot-deploying...? -- costin --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user