Hi again,

Going over Mickey's solution again, I noticed that I had failed to add the jakarta-ojb-xxx.jar file into the .sar file. When I did this all the ojb stuff loaded cleanly, but the web console wouldn't load (exception output follows). When I removed the .sar file, jboss loads everything fine including the web console (and the web console works).

Phil

14:56:55,646 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
-3.0.3/server/default/deploy/jmx-console.war/
14:56:56,107 INFO [jbossweb] Registered jboss.web:Jetty=0,JBossWebApplicationCo
ntext=1,context=/jmx-console
14:57:13,412 INFO [jbossweb] Started WebApplicationContext[/jmx-console,file:/C
:/jboss-3.0.3/server/default/deploy/jmx-console.war/]
14:57:13,452 INFO [jbossweb] JSP: init
14:57:13,512 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
.scanner.URLDeploymentScanner$DeployedURL@929a79d3{ url=file:/C:/jboss-3.0.3/ser
ver/default/deploy/jmx-console.war/, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Could not create deployment: file:/C:/
jboss-3.0.3/server/default/deploy/jmx-console.war/; - nested throwable: (java.la
ng.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/S
tring;)Ljava/util/Set;)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:822)


Armin Waibel wrote:
Hi again Phil,

I assume that I can now use a client to look up these services (I'm
testing that now), but that they may not be configured properly since
there is no explicit OJB.properties or repository etc in any of my
currently deployed archives. So the next question is how to package
the

whole thing properly to avoid path/deploy order/other problems?

OK, now you "only" have a packing/deploying problem ;-)
I don't have experience in packing of .ear -files, sorry.

Maybe Mickey could give some more assistance.
Here is an article about j2ee packing
http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html

When do my tests I put all related OJB files in the jboss working dir
(jboss/bin), but this is NOT recommended for production environment.

regards,
Armin

----- Original Message -----
From: "Phil Warrick" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 23, 2002 6:02 PM
Subject: Re: OJB in J2EE Enviroment



Hi Armin and Mickey,

I made some progress and have some questions remaining.  I am using
Win2K, jboss-3.0.3 and ojb-0.9.7.

Following Armin's instructions, I did this:

> 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.

I also needed to add commons-lang-0.1-dev.jar to
...\jboss-3.0.3\server\default\lib
and then jboss started cleanly, including:

11:52:39,609 INFO  [MainDeployer] Starting deployment of package:
file:/C:/jboss
-3.0.3/server/default/deploy/user-service.xml
11:52:39,639 INFO  [STDOUT] ODMGFactory called
11:52:39,669 INFO  [ODMGFactory] Creating
11:52:39,669 INFO  [ODMGFactory] Created
11:52:39,679 INFO  [PBFactory] Creating
11:52:39,689 INFO  [PBFactory] Created
11:52:39,689 INFO  [ODMGFactory] Starting
11:52:39,699 INFO  [STDOUT] ** OJB-ODMG MBean integration
11:52:39,709 INFO  [STDOUT] ** ODMGFactory:
org.jboss.ojb.odmg.ODMGFactory / Def
aultDomain:service=ODMG,name=ojb/defaultODMG
11:52:39,719 INFO  [STDOUT] ** Use ODMGFactory via lookup:
11:52:39,719 INFO  [STDOUT] ** ODMGFactory factory = (ODMGFactory)
ctx.lookup(ja
va:/ojb/defaultODMG)
11:52:39,729 INFO  [STDOUT] ** Implementation odmg =
factory.getInstance();

11:52:39,729 INFO  [ODMGFactory] Started
11:52:39,739 INFO  [PBFactory] Starting
11:52:39,749 INFO  [PBFactory] PBFactory: org.jboss.ojb.pb.PBFactory /
DefaultDo
main:service=PB,name=ojb/PBAPI
11:52:39,759 INFO  [PBFactory] Lookup PBFactory via 'java:/ojb/PBAPI'
11:52:39,759 INFO  [PBFactory] Started
11:52:39,769 INFO  [MainDeployer] Deployed package:
file:/C:/jboss-3.0.3/server/
default/deploy/user-service.xml

and

11:39:01,200 INFO  [MainDeployer] Starting deployment of package:
file:/C:/jboss-3.0.3/server/default/deploy/ojb-beans.jar
11:39:01,370 INFO  [EjbModule] Creating
11:39:01,380 INFO  [EjbModule] Deploying ODMGSessionBean
11:39:01,401 INFO  [EjbModule] Deploying PBSessionBean
11:39:01,441 INFO  [EjbModule] Created
11:39:01,441 INFO  [EjbModule] Starting
11:39:01,491 INFO  [EjbModule] Started
11:39:01,491 INFO  [MainDeployer] Deployed package:
file:/C:/jboss-3.0.3/server/default/deploy/ojb-beans.jar

I assume that I can now use a client to look up these services (I'm
testing that now), but that they may not be configured properly since
there is no explicit OJB.properties or repository etc in any of my
currently deployed archives. So the next question is how to package
the

whole thing properly to avoid path/deploy order/other problems?

Note that following Mickey's approach, I put the jars in
...\jakarta-ojb-0.9.7\lib into
his jakarta-ojb.sar file and put that file into
...\jboss-3.0.3/server/default/deploy

I get my initial error about the service not being registered:

11:13:05,859 ERROR [URLDeploymentScanner] Failed to deploy:

org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@c8fe579b{
url=file:/C:/jboss-3.0.3/server/default/deploy/jakarta-ojb.sar, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: DefaultDomain:service=ODMG,name=ojb/defaultODMG is not registered.; - nested throwable: (javax.management.InstanceNotFoundException: DefaultDomain:service=ODMG,name=ojb/defaultODMG is not registered.)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:227)
...



Armin Waibel wrote:

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 thi

s 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


er.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(MainD

eployer.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>


--
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>

Reply via email to