I'm using JBoss 4.2.2 and building an application with Hibernate 4.0.1.Final. I'm confused about how to setup my persistence.xml provider class. Currently, in my JAR's META-INF directory, I have this persistence.xml
but upon deploying my JAR to JBoss, I'm greeted with this error
What class should I be using for the provider given my app server and Hibernate version? - Dave
Thanks for that clarification. I'm going to check that out, but my application is a JAR, not a WAR. I've got through hell trying to figure out how to instruct JBoss to prefer the classes in my JAR instead of its own, but I haven't figured out how. If you know, or have suggestions for another packaging structure, I'm grateful.
The only thing in the JAR is a Quartz job that I want to run periodically (There are some JBoss annotations that let me set up the cron). Everything else in the JAR are classes that support that job. Our sysadmin has said I need to do this in JBoss instead of setting up a traditional Unix cron job.
I'm open to other packaging configs, but I don't think WAR is appropriate because I don't have any web components.
Thanks for getting back to me with all the Olympics on, - Dave
An EJB jar is an example of a deployable artifact, it doesn't have to be an EAR or WAR.
Thanks James I had read a little on it awhile back (although I have zero experience with it) however I though that was something that came with the EJB 3 stuff and was newer than JBOSS 4. Anyways I stand corrected
Edit I found this with all the deployment descriptors for a newer version of JBOSS I did not see an equivalent document for 4.
After reading over your link with the deployment descriptors, I'm at a loss. What deployment descriptor is appropriate for my application, in which I just want to run a Quartz job periodically? I appreciate any recommendations although I'm going to see if jboss-client.xml is supported for JBoss 4. - Dave
Well whatever deployment descriptor you have seems to be working for you as far as deployment is concerned. I was hoping that you could use jboss-classloading.xml to force your application to use the libs that are included with your application but it seems this was added in JBOSS 5. I think I will move this to the JBOSS forum hopefully some JBOSS experts can help you with this.
The real question is why do you want to use JPA 2 (Hibernate 4.x) in an environment which doesn't support JPA 2 (JBoss AS 4.x)? Why not use Hibernate 3 if you want to stick wth JBoss AS 4.x. If at all you are using any JPA 2 specific features then it really means you need a runtime environment which supports JPA 2. JBoss AS 4.x is not that environment. You'll have to upgrade.
Ah Jaikiran, I've seen you weigh in on this issue many times. I've wrote my app in Hibernate b/c I didn't think my company was using an app server this out of date. Before I rewrite my app, you above all would know, can JBoss be instructed to use my Hibernate JARs over its own? In my JAR file, I have this file, META-INF/jboss.xml
but JBoss appears to be loading older versions of the Hibernate classes ...
I have verified the proper Hibernate classes are getting included in the JAR. Thanks, - Dave
That exception looks like it wants you to use AnnotationConfiguration which is deprecated in the version of hiberate you are using. You are probably using Configuration which is what you should be doing. The only thing I can think is one of the transitive dependencies are still being included by jboss and its not using what you have in your jar. Maybe rather than depending on maven to bundle the transitive dependencies to hibernate-core explicitly define them and verify that each one is in your jar.