RE: [JBoss-user] general deployment question
Concerning the ejb-link The EJB2.0 spec clearly states (20.3.2) that ...the target enterprise bean can be in any ejb-jar file in the same J2EE application as the referencing application component. Exactly the same is in J2EE 1.3 spec (J2EE.5.3.2) According to me this means, in the same EAR! This is exactly what I wanted for my application, but it doesn't seems to work in JBoss 3.0.0 (beta2) (see my posting on Friday)!!! Eric just mentioned he got it to work in JBoss (which version please?) and I'm very curious about it! So maybe you can give me a hint on how I can get it to work in JBoss? Feel sorry for you 'bout Borland ;-) Sam. From: Eric Kaplan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Sun, 10 Mar 2002 11:46:39 -0500 Subject: [JBoss-user] general deployment question This is a multi-part message in MIME format. --=_NextPart_000_0004_01C1C829.3DCF61A0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit We have built a large number of session and bmp entity beans as part of our technology framework. For historical reasons we organized each entity bean (along with home and remote interfaces and primary key class) into a jar. Same with the session beans. In the deployment descriptors, we used the ejb-link tag to identify ejb references, even though the references were not in the same jar. Again, this was because the documentation at the time on all this stuff was not very good and we just had examples to go off of. Somehow, we get away with this in jboss, even though it's not correct to use ejb-link for references outside of a jar. Note, all the jar files, and there are about 30 now, are packaged into an ear. We then have a jboss.xml per jar which basically defines any jdbc references we may have as well as declares the jndi names for each of the beans in the ejb-jar.xml. We have a client who insists on using borland's app server (let's not get into why here...) and borland is choking, and i think rightly so, because the ejb-link references are to beans outside of the jar. My question is, why was i able to get away with this in jboss. In a related area, we have a fair number of helper classes that all these beans use (base classes for our beans, data structures to hold the data passed back to the client apps, etc.). Right now, we add jar files holding these classes, as well as third party jars, to the jboss classpath. Is this the right thing to do, or is the right thing to stuff these helper classes into each jar (or the ear file)... I apologize if this question seems basic, but we've spent more time just trying to make things work and less trying to understand every single aspect of this. Things are calming down a bit right now and I'd like to reexamine our approach here. Most of the documentation out there deals with relatively simple applications, or gets bogged down with discussions of war files, etc. (we're not a web app, at least not yet). Any help or suggestions would be much appreciated. As I've said, we've managed to get all this to work, though I think we have some configuration issues yet to deal with. Thanks Eric Kaplan Armanta, Inc. 55 Madison Ave. Morristown, NJ 07960 Phone: (973) 326-9600 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] ejb-local-ref from an MDB to an Entity in the same EAR, but diffe rent ejb jars (jboss 3.0.0beta2)
Indeed, I got it to work with ejb-ref and hence remote interfaces even in different jars, and as I recall that means the jboss.xml contained the JNDI name of the referenced remote home interface BUT... why do we have local interfaces for!? I tought to speed up intra-JVM calls and since my referencing and referenced beans are running in the same JBoss server, I want to use ejb-local-ref and that I still didn't get to work. Sam. -Original Message- From: Alex Loubyansky [mailto:[EMAIL PROTECTED]] Sent: maandag 11 maart 2002 10:32 To: 'Sam De Backer'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [JBoss-user] ejb-local-ref from an MDB to an Entity in the same EAR, but diffe rent ejb jars (jboss 3.0.0beta2) Hello, everybody! To Sam: Have you figured it out? The cause could be the beans are in different jars and you use ejb-local-ref. It should work in case of remote interfaces and: ejb-ref in ejb-jar.xml and jboss.xml or place your beans in the same jar file and use ejb-local-ref. To all: Mastering EJB II says about ejb-link this: ... The ejb-name of the bean we're referring to. Note: You can also refer to beans in different jar file, by using a syntax such as ../products/product.jar#ProductEJB. How should it be applied to JBoss? If there is declaration of ejb-ref in ejb-jar.xml and neither of ejb-ref in jboss.xml and ejb-link in ejb-jar.xml is specified, jboss complains that either ejb-ref in jboss.xml or ejb-link in ejb-jar.xml must be specified. I've made to jar files each containing one SLSB with remote interfaces. ReferencingBean references ReferencedBean and calls its method. Declaring ejb-ref in ejb-jar.xml and jboss.xml it works. But when I tried to use ejb-link in ejb-jar.xml instead of ejb-ref in jboss.xml it said me this: 2002-03-11 11:17:10,207 DEBUG [org.jboss.ejb.StatelessSessionContainer] Binding an EJBReference ejb/Referenced 2002-03-11 11:17:10,207 DEBUG [org.jboss.ejb.StatelessSessionContainer] Binding ejb/Referenced to internal JNDI source: referenced-ejb.jar#ReferencedBean 2002-03-11 11:17:10,207 ERROR [org.jboss.ejb.StatelessSessionContainer] Exception in service lifecyle operation: create org.jboss.deployment.DeploymentException: Bean referenced-ejb.jar#ReferencedBean not found within this application. I guess I reference referenced-ejb.jar incorrectly. Could someone shed a light? Thanks in advance! alex -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Sam De Backer Sent: Friday, March 08, 2002 5:10 PM To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: [JBoss-user] ejb-local-ref from an MDB to an Entity in the same EAR, but diffe rent ejb jars (jboss 3.0.0beta2) I would like to call an Entity bean from within an MDB and added an ejb-local-ref in my MDB's ejb-jar.xml I also added an ejb-link inside that ejb-local-ref with the name of my Entity bean. Everything packed up in an EAR. When deploying to JBoss i get an org.jboss.deployment.DeploymentException (Bean Workplace not found within this application.) Isn't this supported in JBoss? Or am I overlooking things? Sam. The ear struct: -- lab04app.ear - META-INF - application.xml (containing modules lab03.jar and lab04.jar) - lab03.jar - lab04.jar --- lab03.jar - META-INF - ejb-jar.xml - jboss.xml - lab03 - ... (classes of lab03 package, including the Workplace Entity bean) lab04.jar - META-INF - ejb-jar.xml (containing ejb-local-ref+ejb-link to Workplace) - jboss.xml - lab04 - ... (classes of lab04 package calling Workplace bean through ref) the log: ... 2002-03-08 15:49:41,090 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying lab03.jar 2002-03-08 15:49:41,090 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/d eploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.la b04app.ear^/la b04.jar 2002-03-08 15:49:41,220 DEBUG [org.jboss.ejb.EJBDeployer] Verifying njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/d eploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.la b04app.ear^/la b04.jar 2002-03-08 15:49:41,230 DEBUG [org.jboss.ejb.EJBDeployer] Deploying: njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/d eploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.la b04app.ear^/la b04.jar 2002-03-08 15:49:41,230 INFO [org.jboss.ejb.EjbModule] Creating 2002-03-08 15:49:41,230 DEBUG [org.jboss.ejb.EjbModule] Application.start(), begin 2002-03-08 15:49:41,230 DEBUG [org.jboss.management.j2ee.EjbModule] EjbModule.create(), server name: J2EEServer=Single 2002-03-08 15:49:41,240 DEBUG
[JBoss-user] ejb-local-ref from an MDB to an Entity in the same EAR, but different ejb jars (jboss 3.0.0beta2)
I would like to call an Entity bean from within an MDB and added an ejb-local-ref in my MDB's ejb-jar.xml I also added an ejb-link inside that ejb-local-ref with the name of my Entity bean. Everything packed up in an EAR. When deploying to JBoss i get an org.jboss.deployment.DeploymentException (Bean Workplace not found within this application.) Isn't this supported in JBoss? Or am I overlooking things? Sam. The ear struct: -- lab04app.ear - META-INF - application.xml (containing modules lab03.jar and lab04.jar) - lab03.jar - lab04.jar --- lab03.jar - META-INF - ejb-jar.xml - jboss.xml - lab03 - ... (classes of lab03 package, including the Workplace Entity bean) lab04.jar - META-INF - ejb-jar.xml (containing ejb-local-ref+ejb-link to Workplace) - jboss.xml - lab04 - ... (classes of lab04 package calling Workplace bean through ref) the log: ... 2002-03-08 15:49:41,090 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying lab03.jar 2002-03-08 15:49:41,090 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/deploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.lab04app.ear^/la b04.jar 2002-03-08 15:49:41,220 DEBUG [org.jboss.ejb.EJBDeployer] Verifying njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/deploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.lab04app.ear^/la b04.jar 2002-03-08 15:49:41,230 DEBUG [org.jboss.ejb.EJBDeployer] Deploying: njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/deploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.lab04app.ear^/la b04.jar 2002-03-08 15:49:41,230 INFO [org.jboss.ejb.EjbModule] Creating 2002-03-08 15:49:41,230 DEBUG [org.jboss.ejb.EjbModule] Application.start(), begin 2002-03-08 15:49:41,230 DEBUG [org.jboss.management.j2ee.EjbModule] EjbModule.create(), server name: J2EEServer=Single 2002-03-08 15:49:41,240 DEBUG [org.jboss.management.j2ee.J2EEDeployedObject] File: njar:file:/C:/experimental/jboss-3.0.0beta2/server/mysql/tmp/deploy/C/experi mental/jboss-3.0.0beta2/server/mysql/deploy/lab04app.ear/70.lab04app.ear^/la b04.jar, descriptor: META-INF/ejb-jar.xml 2002-03-08 15:49:41,240 DEBUG [org.jboss.management.j2ee.EjbModule] Create EJB-Module, name: lab04.jar, application: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=lab04app.e ar,type=J2EEApplication, dd: ?xml version=1.0? !DOCTYPE ejb-jar PUBLIC -//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN http://java.sun.com/dtd/ejb-jar_2_0.dtd; ejb-jar enterprise-beans message-driven ejb-nameWorkplaceCreator/ejb-name ejb-classlab04.WorkplaceCreatorBean/ejb-class transaction-typeContainer/transaction-type message-driven-destination destination-typejavax.jms.Queue/destination-type /message-driven-destination ejb-local-ref ejb-ref-nameejb/local/Workplace/ejb-ref-name ejb-ref-typeEntity/ejb-ref-type local-homelab03.WorkplaceLocalHome/local-home locallab03.WorkplaceLocal/local ejb-linkWorkplace/ejb-link /ejb-local-ref /message-driven /enterprise-beans /ejb-jar 2002-03-08 15:49:41,240 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEDomain=Manager,name=lab04.jar,J2EEServer=Single, J2EEApplication=lab04app.ear,type=EjbModule 2002-03-08 15:49:41,240 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEDomain=Manager,J2EEServer=Single,name=lab04app.e ar,type=J2EEApplication 2002-03-08 15:49:41,240 INFO [org.jboss.ejb.EjbModule] Deploying WorkplaceCreator 2002-03-08 15:49:41,261 DEBUG [org.jboss.ejb.MessageDrivenContainer] Begin java:comp/env for EJB: WorkplaceCreator 2002-03-08 15:49:41,261 DEBUG [org.jboss.ejb.MessageDrivenContainer] TCL: java.net.URLClassLoader@72be27 2002-03-08 15:49:41,261 DEBUG [org.jboss.ejb.MessageDrivenContainer] Binding an EJBLocalReference ejb/local/Workplace 2002-03-08 15:49:41,261 DEBUG [org.jboss.ejb.MessageDrivenContainer] Binding ejb/local/Workplace to bean source: Workplace 2002-03-08 15:49:41,261 ERROR [org.jboss.ejb.MessageDrivenContainer] Serious error in init: org.jboss.deployment.DeploymentException: Bean Workplace not found within this application. at org.jboss.ejb.Container.setupEnvironment(Container.java:982) at org.jboss.ejb.Container.create(Container.java:497) at org.jboss.ejb.MessageDrivenContainer.create(MessageDrivenContainer.java:159) at org.jboss.ejb.Container.invoke(Container.java:783) at
[JBoss-user] CMP2.0 - CMR-fields sometimes (reproduceable!) not persisted in DB (jboss3.0.0beta)?
Hi there, I'm puzzled, am I overlooking something here, or is this a bug. jboss 3.0.0beta, JDK1.3.0, mySQL 3.23.47, mm-mysql-2.0.11, WinNT 4.0 SP6a I have a simple scheme, 2 entity beans (CMP), A (Workplace) and B (Booking), related One to Many, like A*B, and a session bean C (Booker) which act as a session facade to create B objects that need to be related to A objects. B has a CMR field, theA (theWorkplace). There is a create method for B in BLocalHome, which takes as an argument (a.o.) an ALocal. In B's ejbCreate I set the CMP-fields, in ejbPostCreate I set the CMR field theA. The create method of BLocalHome is called from within the session bean C, giving me as returnvalue a BLocal object. This is the setup, now the problem. When my session bean C creates the B (and tries to link it to the A) and doesn't do anything more after that (simply returns), the database doesn't get updated, no UPDATE sql statement in the jboss-log to set the FK-column B.theA to A's PK! (i also use a SQL spy (P6Spy) to see all SQL going to the DB, nada there either!) 2002-03-01 17:06:23,656 INFO [Default] BookingBean::ejbCreate null 2002-03-01 17:06:23,656 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Booking] Create: pk=1014998783656 2002-03-01 17:06:23,656 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Booking] Executing SQL: SELECT COUNT(*) FROM Booking WHERE id=? 2002-03-01 17:06:23,656 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Booking.id] Set parameter: index=1, jdbcType=BIGINT, value=1014998783656 2002-03-01 17:06:23,666 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Booking] Executing SQL: INSERT INTO Booking (id, date, person, workplace) VALUES (?, ?, ?, ?) 2002-03-01 17:06:23,666 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Booking.id] Set parameter: index=1, jdbcType=BIGINT, value=1014998783656 2002-03-01 17:06:23,666 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Booking.date] Set parameter: index=2, jdbcType=DATE, value=Mon Feb 25 00:00:00 GMT+01:00 2002 2002-03-01 17:06:23,686 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Booking.person] Set parameter: index=3, jdbcType=VARCHAR, value=Joeri Leemans 2002-03-01 17:06:23,686 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Booking.id] Set parameter: index=4, jdbcType=BIGINT, value=NULL 2002-03-01 17:06:23,686 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Booking] Create: Rows affected = 1 2002-03-01 17:06:23,706 INFO [Default] BookingBean::ejbPostCreate 1014998783656 2002-03-01 17:06:23,706 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Workplace] RESET PERSISTENCE CONTEXT: id=1014998783475 2002-03-01 17:06:23,706 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.Workplace] load data: entity=Workplace pk=1014998783475 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.Workplace] No preload data found: entity=Workplace pk=1014998783475 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Workplace] Default eager-load for entity 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Workplace] Executing SQL: SELECT name, company, floor FROM Workplace WHERE (id=?) 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Workplace.id] Set parameter: index=1, jdbcType=BIGINT, value=1014998783475 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Workplace.name] Get result: index=1, javaType=java.lang.String, Simple, value=BRFI1-2-034 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Workplace.compan y] Get result: index=2, javaType=java.lang.String, Simple, value=Wemmel 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Workplace.floor] Get result: index=3, javaType=int, Simple, value=2 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.Workplace.Booking_ workplace] Read ahead cahce load: cmrField=Booking_workplace pk=1014998783475 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.Workplace] load data: entity=Workplace pk=1014998783475 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.Workplace] No preload data found: entity=Workplace pk=1014998783475 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.Workplace] Executing SQL: SELECT id FROM Booking WHERE (workplace=?) 2002-03-01 17:06:23,716 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.Booking.id] Set parameter: index=1, jdbcType=BIGINT, value=1014998783475 2002-03-01 17:06:23,726 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.Workplace] Store command NOT executed. Entity is not dirty: pk=1014998783475 When my session bean C creates the B (and