0

All,

I've tried to find this and can't, I hope it's not a duplicate question. I'm working on getting datanucleus and tomcat working on eclipse.

  1. I've managed to build and deploy a project that uses datanucleus as an standalone application and it works fine.

  2. I've managed to build a dynamic web application that initialises the datanucleus jdo persistencemanager and that also works fine.

  3. However where I try to use the classes that were working on standalone app I get an exception telling me my classes are not enhanced. I've enabled the datanucleus plugin on this project and used the manual and automatic enhancer however I see no logs when I run the enhancer.

So I'm thinking most likely this is about me not having the correct orm file location! I had issue putting my persistence.xml file in the right location and I resolved it by manually building a property and instantiating my factory that way.

All I need is to know the proper location of orm file (in this case package-mysql.xml) when we move from a standalone scenario to web. I've tried under src folder, same path as my classes (this is what I had for standalone) and also copying it to WEB-INF/lib folder of the webcontent but none has worked.

Any help or pointer is appreciated.

Also if you could point me to a full sample eclipse project with full structure I guess I can find all my answers. I haven't been successful finding one.

Amir

Amir Peivandi
  • 349
  • 4
  • 19
  • 1
    Would have thought the best place to look for that is in Tomcat docs. DataNucleus AFAIK will just look for a CLASSPATH. Where you put things to get them in the CLASSPATH is Tomcat configuration. JDO accepts .orm/.jdo files in standard locations _in the CLASSPATH_ so make sure they're in the CLASSPATH that you app can see – Neil Stockton Feb 11 '14 at 16:19

1 Answers1

2

This SO answer suggests that you try placing persistence.xml under src/META-INF

the root of the persistence unit is the WEB-INF/classes directory; the persistence.xml file is therefore contained in the WEB-INF/classes/META-INF directory

My directory structure is as follows

myProject
+ src
++ main
+++ java
++++ com
+++++ mysite
++++++ ...
++++ META-INF
+++++ persistence.xml
Community
  • 1
  • 1
icma
  • 81
  • 3