You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by coder_joe <co...@yahoo.de> on 2009/11/18 16:22:34 UTC

Quartz and OpenEJB

Hi,

The last days i started with EJB3 and i must say OpenEJB is a great software
for learning the EJB technology, cause no fat application server is needed,
nearly no configuration, i only have to start the server, deploy/undeploy
EJBs and learn, wonderful. Thanks for that.

But now to my questions:

Is it possible to use the quartz scheduler from an EJB?
if yes, is there any howto?
Does it work if OpenEJB runs in standalone mode, or is an application server
needed ?

thx



-- 
View this message in context: http://old.nabble.com/Quartz-and-OpenEJB-tp26408403p26408403.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Quartz and OpenEJB

Posted by David Blevins <da...@visi.com>.
On Nov 19, 2009, at 1:38 AM, coder_joe wrote:

>> We don't have a formal tutorial, but the question has come up and  
>> this
>> post gives quite a few details:
>> http://old.nabble.com/Re%3A-need-help-getting-quartz-ra.rar-file-to-deploy-p18783086.html
>
> i downloaded the quartz-app.zip but can't get it working

Looks like the contents of the zip were simply outdated.  The thing  
that prevented us from adding that example to our list of examples in  
svn was the licensing -- we can't use LGLP code.  It's unfortunate as  
that example shows people how to use Resource Adapters and it shows  
how a great way to get Quartz going in an app.

This has bothered me for a while, so I finally bit the bullet and went  
ahead and created an ASL licensed Quartz Resource Adapter.  It's  
currently in the openejb-core jar, but we'll probably move it to a new  
section where we can keep all our resource adapters.

I also fixed up that example to use it and added it to our svn:

  http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/quartz-app/

I published new 3.1.3-SNAPSHOT binaries, so all you should have to do  
is check out the above example and run it.

Give this example a try and let us know how it goes!

-David


Re: Quartz and OpenEJB

Posted by coder_joe <co...@yahoo.de>.
Hi,

> It is possible to use Quartz to fire events to an MDB via a standard  
> Java EE Connector.  That will work in any compliant EJB container.

Good to know.

> For EJB 3.1 there is a new @Schedule annotation which will be really  
> quite fantastic.  Our implementation will use Quartz under the  
> covers.  We have some work on this now, but nothing complete yet.  But  
> a deeper integration is planned.

This sounds great.

> We don't have a formal tutorial, but the question has come up and this  
> post gives quite a few details:
> http://old.nabble.com/Re%3A-need-help-getting-quartz-ra.rar-file-to-deploy-p18783086.html

i downloaded the quartz-app.zip but can't get it working:
As suggested first i installed the quartz.jar:
 mvn install:install-file -DgroupId=org.jboss -DartifactId=quartz-ra
-Dversion=1.0 -Dpackaging=jar -Dfile=quartz-ra.jar

this worked. Then i:

c:\test\test\quartz-app>mvn clean install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Quartz App
[INFO]   Quartz Resource Adapter
[INFO]   Quartz Beans
[INFO]
------------------------------------------------------------------------
[INFO] Building Quartz App
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing c:\test\test\quartz-app\pom.xml to C:\Dokumente und
Einstellun
gen\axelg\.m2\repository\com\example\quartz-app\0.0.1-SNAPSHOT\quartz-app-0.0.1-
SNAPSHOT.pom
[INFO]
------------------------------------------------------------------------
[INFO] Building Quartz Resource Adapter
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\test\test\quartz-app\quartz-ra\target
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered
resources,
i.e. build is platform dependent!
[INFO] Copying 1 resource
Downloading:
http://people.apache.org/repo/m2-snapshot-repository//org/jboss/qua
rtz-ra/1.0/quartz-ra-1.0.pom
[INFO] Unable to find resource 'org.jboss:quartz-ra:pom:1.0' in repository
apach
e-m2-snapshot (http://people.apache.org/repo/m2-snapshot-repository/)
Downloading:
http://repo1.maven.org/maven2/org/jboss/quartz-ra/1.0/quartz-ra-1.0
.pom
[INFO] Unable to find resource 'org.jboss:quartz-ra:pom:1.0' in repository
centr
al (http://repo1.maven.org/maven2)
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered
resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\test\test\quartz-app\quartz-ra\src
\test\resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar:
C:\test\test\quartz-app\quartz-ra\target\quartz-ra-0.0.1-SN
APSHOT.jar
[INFO] [install:install {execution: default-install}]
[INFO] Installing
C:\test\test\quartz-app\quartz-ra\target\quartz-ra-0.0.1-SNAPS
HOT.jar to C:\Dokumente und
Einstellungen\axelg\.m2\repository\com\example\quart
z-ra\0.0.1-SNAPSHOT\quartz-ra-0.0.1-SNAPSHOT.jar
[INFO]
------------------------------------------------------------------------
[INFO] Building Quartz Beans
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\test\test\quartz-app\quartz-beans\target
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered
resources,
i.e. build is platform dependent!
[INFO] Copying 1 resource
[WARNING] POM for 'javax.mail:mail:pom:1.4:compile' is invalid.

Its dependencies (if any) will NOT be available to the current build.
Downloading:
http://people.apache.org/repo/m2-snapshot-repository//org/apache/op
enejb/openejb-core/3.1-SNAPSHOT/openejb-core-3.1-SNAPSHOT.pom
[INFO] Unable to find resource
'org.apache.openejb:openejb-core:pom:3.1-SNAPSHOT
' in repository apache-m2-snapshot
(http://people.apache.org/repo/m2-snapshot-re
pository/)
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to
C:\test\test\quartz-app\quartz-beans\target\cl
asses
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
error: error reading C:\Dokumente und
Einstellungen\axelg\.m2\repository\javax\m
ail\mail\1.4\mail-1.4.jar; error in opening zip file

[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Thu Nov 19 10:31:35 CET 2009
[INFO] Final Memory: 15M/28M
[INFO]
------------------------------------------------------------------------
c:\test\test\quartz-app>


thx

-- 
View this message in context: http://old.nabble.com/Quartz-and-OpenEJB-tp26408403p26421249.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Quartz and OpenEJB

Posted by David Blevins <da...@visi.com>.
On Nov 18, 2009, at 7:22 AM, coder_joe wrote:

> The last days i started with EJB3 and i must say OpenEJB is a great  
> software
> for learning the EJB technology, cause no fat application server is  
> needed,
> nearly no configuration, i only have to start the server, deploy/ 
> undeploy
> EJBs and learn, wonderful. Thanks for that.

Thanks for that, too!  We appreciate the note.

> But now to my questions:
>
> Is it possible to use the quartz scheduler from an EJB?
> if yes, is there any howto?
> Does it work if OpenEJB runs in standalone mode, or is an  
> application server
> needed ?

It is possible to use Quartz to fire events to an MDB via a standard  
Java EE Connector.  That will work in any compliant EJB container.

We don't have a formal tutorial, but the question has come up and this  
post gives quite a few details:

   http://old.nabble.com/Re%3A-need-help-getting-quartz-ra.rar-file-to-deploy-p18783086.html


For EJB 3.1 there is a new @Schedule annotation which will be really  
quite fantastic.  Our implementation will use Quartz under the  
covers.  We have some work on this now, but nothing complete yet.  But  
a deeper integration is planned.

Hope this helps!

-David