Hi Phil,
----- Original Message -----
From: "Phil Warrick" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, October 22, 2002 11:04 PM
Subject: Re: OJB in J2EE Enviroment
> Hi Armin,
>
> I'm having trouble while following your instructions. This is what I
did:
>
> 1) Changed the OJB.properties to
>
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFacto
ryPassThroughImpl
set
useAutoCommit=0
too
seems to be a classpath problem or deploy order problem,
jboss could not found the mbeans.
To *test* the deployment of the mbeans you could try the following:
put the jakarta-ojb-xxx.jar and
jakarta-ojb-junit-xxx.jar in
...\jboss-3.0.3\server\default\lib
Put ejb-jar.xml, jboss.xml and ojb-beans.jar of
...\jakarta-ojb-0.9.7\target\srcejb in
...\jboss-3.0.3\server\default\deploy
Start jboss.
Now jboss should deploy the mbeans and
you should be able to lookup the sample beans.
> 7) Put ejb-jar.xml, jboss.xml and ojb-beans.jar of
> ...\jakarta-ojb-0.9.7\target\srcejb in
> ...\jboss-3.0.3\server\default\deploy
BTW, the ojb-jar.xml contains
the ejb-jar.xml and jboss.xml files,
thus you should not put this files in the deploy dir
regards,
Armin
>
> 2) bin\build jar
>
> 3) bin\build war
>
> 4) ant -buildfile build-xdoclet.xml
>
> 5) Put the MBean declaration
>
> <mbean code="org.jboss.ojb.odmg.ODMGFactory"
> name="DefaultDomain:service=ODMG,name=ojb/defaultODMG">
> <attribute name="JndiName">ojb/defaultODMG</attribute>
> </mbean>
> <mbean code="org.jboss.ojb.pb.PBFactory"
> name="DefaultDomain:service=PB,name=ojb/PBAPI">
> <attribute name="JndiName">ojb/PBAPI</attribute>
> </mbean>
>
> in ...\jboss-3.0.3\server\default\deploy\user-service.xml
>
> 6) Put dist\ojb-servlet.war in
> ...\jboss-3.0.3\server\default\deploy
>
> 7) Put ejb-jar.xml, jboss.xml and ojb-beans.jar of
> ...\jakarta-ojb-0.9.7\target\srcejb in
> ...\jboss-3.0.3\server\default\deploy
>
> JBoss gives the errors below at startup.
>
> Can you see what I've done wrong?
>
> Thanks very much,
>
> Phil
>
> ...
> 16:49:25,903 INFO [MainDeployer] Starting deployment of package:
> file:/D:/API/j
> boss-3.0.3/server/default/deploy/user-service.xml
> 16:49:25,943 ERROR [URLDeploymentScanner] Failed to deploy:
> org.jboss.deployment
>
anner.URLDeploymentScanner$DeployedURL@f4fdb2f{
> url=file:/D:/API/jboss-3.0.3/
> server/default/deploy/user-service.xml, deployedLastModified=0 }
> org.jboss.deployment.DeploymentException:
> DefaultDomain:service=ODMG,name=ojb/de
> faultODMG is not registered.; - nested throwable:
> (javax.management.InstanceNotF
> oundException: DefaultDomain:service=ODMG,name=ojb/defaultODMG is not
> registered
> .)
> at org.jboss.deployment.SARDeployer.create(SARDeployer.java:227)
> at org.jboss.deployment.MainDeployer.create(MainDeployer.java:755)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:615)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
> at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy4.deploy(Unknown Source)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
> tScanner.java:427)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
> ploymentScanner.java:648)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
> canner.java:499)
> at
> org.jboss.deployment.
scanner.AbstractDeploymentScanner.startService(A
> bstractDeploymentScanner.java:261)
> at
> org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
> 64)
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown
Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
> ler.java:976)
> at $Proxy0.start(Unknown Source)
> at
> org.jboss.system.ServiceController.start(ServiceController.java:397)
> at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy3.start(Unknown Source)
> at
org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)
> at
org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:564)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
> at
org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
> at org.jboss.Main.boot(Main.java:148)
> at org.jboss.Main$1.run(Main.java:381)
> at java.lang.Thread.run(Thread.java:536)
> Caused by: javax.management.InstanceNotFoundException:
> DefaultDomain:service=ODM
> G,name=ojb/defaultODMG is not registered.
> at
> org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistr
> y.java:362)
> at
> org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java
> :528)
> at
> org.jboss.system.ServiceController.getServiceProxy(ServiceController.
> java:737)
> at
> org.jboss.system.ServiceController.create(ServiceController.java:277)
>
> at
> org.jboss.system.ServiceController.create(ServiceController.java:243)
>
> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown
Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy3.create(Unknown Source)
> at
org.jboss.deployment.SARDeployer.create(SARDeployer.java:217)
> ... 46 more
>
> ...
>
> 16:49:30,079 INFO [MainDeployer] Starting deployment of package:
> file:/D:/API/j
> boss-3.0.3/server/default/deploy/ojb-beans.jar
> 16:49:30,169 ERROR [EJBDeployer] Verfiy failed
> java.lang.NoClassDefFoundError: org/odmg/OQLQuery
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Class.java:1627)
> at java.lang.Class.privateGetPublicMethods(Class.java:1655)
> at java.lang.Class.getMethods(Class.java:815)
> at
> org.jboss.verifier.strategy.AbstractVerifier.hasEJBCreateMethod(Abstr
> actVerifier.java:643)
> at
> org.jboss.verifier.strategy.EJBVerifier20.verifySessionBean(EJBVerifi
> er20.java:963)
> at
> org.jboss.verifier.strategy.EJBVerifier20.checkSession(EJBVerifier20.
> java:90)
> at
org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:133)
> at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:343)
> at
org.jboss.deployment.MainDeployer.create(MainDeployer.java:755)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:615)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
> at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown
Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy4.deploy(Unknown Source)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
> tScanner.java:427)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
> ploymentScanner.java:648)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
> canner.java:499)
> at
> org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
> bstractDeploymentScanner.java:261)
> at
> org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
> 64)
> at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown
Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
> ler.java:976)
> at $Proxy0.start(Unknown Source)
> at
> org.jboss.system.ServiceController.start(ServiceController.java:397)
> at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown
Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy3.start(Unknown Source)
> at
org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)
> at
org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
> at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:564)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
> nDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
> at
org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
> at org.jboss.Main.boot(Main.java:148)
> at org.jboss.Main$1.run(Main.java:381)
> at java.lang.Thread.run(Thread.java:536)
>
> Armin Waibel wrote:
> > Hi Thomas,
> >
> > Get the current CVS head or last source code version.
> > (When using the CVS head you will find more sample beans)
> >
> > Generate the docs with
> > bin\build.bat doc
> >
> > Generated docs you will find under .../target/doc
> > Instruction for deployment in
> > jboss see:
> > User Documentation/Deployment
> >
> > To generate the shipped sample beans:
> >
> > - first build the ojb jars
> > bin\build.bat jar
> > - then build the sample beans jar using xdoclet
> > ant -buildfile build-xdoclet.xml
> > the jar and the generated src code
> > you could find under ../target/srcejb
> > (When using a different AppServer then jboss,
> > change the build-xdoclet.xml file doclet task, see
> > xdoclet documentation)
> > Deploy the jar in your AppSever and run one of
> > the test clients (or try to run the AllTests.java client).
> >
> > The original source code of the sample
> > beans you could find under ../src/ejb/...
> >
> > repository.xml:
> > For the jdbc-connection-descriptor tag Matthew had
> > introduced an eager-release attribute, when using
> > jboss (tested for 3.0.3) this should be set 'true'
> > (default was 'false'). If set 'true' the obtained connection
> > by the PB was "closed" after each Statement use.
> >
> > Sample:
> > ....
> > <jdbc-connection-descriptor
> > platform="Hsqldb"
> > jdbc-level="2.0"
> > jndi-datasource-name="java:DefaultDS"
> > username="sa"
> > password=""
> > eager-release="true"
> > />
> >
> > Currently we only test under JBoss 3.0.3
> > (3.x versions <3.0.3 cause trouble)
> >
> >
> > HTH
> >
> > regards,
> > Armin
> >
> > ----- Original Message -----
> > From: "Thomas H�sler" <[EMAIL PROTECTED]>
> > To: "OJB Users List" <[EMAIL PROTECTED]>
> > Sent: Thursday, October 17, 2002 4:24 PM
> > Subject: OJB in J2EE Enviroment
> >
> >
> > Hi all
> >
> > Did anyone ever use OJB in a J2EE environment? If so what are the
> > experiences? I just read it smoothly integrates into it but no
> > details...
> > Are there any details around about how to use OJB inside a J2EE
system?
> >
> > Tom
> >
> > ------------------------------------------------------------------
> > Thomas H�sler * TietoEnator Consulting AG
> > Industriestrasse 19 * 8304 Wallisellen * Switzerland
> > Tel. +41 (43) 233 45 28 * Fax +41 (43) 233 45 10
> > Mobile +41 (78) 622 03 36
> > <mailto:Thomas.Huesler@;TietoEnator.com>
> > http://www.tietoenator.ch
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:ojb-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:ojb-user-help@;jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:ojb-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:ojb-user-help@;jakarta.apache.org>
>
>
>
--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>