Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Google App Engine Enhancer fails - missing JAR in CLASSPATH

$
0
0

Hello,

 

(question at the end, after the project configuration)

 

I created a MAVEN Google App Engine project with several sub-modules:

  1. WAR: this packages the App for uploading to GAE / running locally in dev server
  2. main JARs: just a couple of jars with business logic
  3. persistence layer JAR: this is the JAR that includes our JPA2 (Datanucleus) infrastructure layer

 

Using the MAVEN project all works fine, I mean, running "mvn package" in project (3) does what it is expected (compile, enhance, etc etc), and running "mvn package" in project (1) works well too (packages all dependencies from (2) and (3), etc.. Thus, running GAE dev server locally from the package generated from project (1) POM works without a problem (I can persist entities, load them, etc).

 

Now, I want to avoid the overhead of running "mvn install" in project (1) everytime I make a change in my code. So, I created a "run configuration" for GAE:

Captura de pantalla 2014-03-12 10.28.56.png

And this is the artifact definition:

Captura de pantalla 2014-03-12 10.30.51.png

I added all dependencies output to the WAR-exploded, so that I get all I need in the target folder (similar to a "mvn package" in the WAR project + explode).

 

Now, the sub-module "core-infra-jpa" has to be enhanced, so the configuration for that module is:

Captura de pantalla 2014-03-12 10.33.18.png

 

So, i I'm not wrong, the run configuration will:

  1. Make all project sub-modules
  2. In the case of core-infra-jpa, enhance after make
  3. Generate WAR-exploded: copy al target folders to WAR-target-folder (this includes classes enhanced from (2))
  4. Run GAE dev server

 

My problem, the enhance step fails:

 

Google AppEngine Enhancer: Encountered a problem: Unexpected exception

Google AppEngine Enhancer: mar 12, 2014 10:15:22 AM org.datanucleus.api.ApiAdapterFactory getApiAdapter

Google AppEngine Enhancer: Grave: Error : Un error ocurrio cuando creando un adaptador "org.datanucleus.api.jpa.JPAAdapter" (quizas no tengas el jar apropiado datanucleus-api-XXX en el CLASSPATH, o el api jar para la especificacion que utilisas?) : Absent Code attribute in method that is not native or abstract in class file javax/persistence/PersistenceException

Google AppEngine Enhancer: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/PersistenceException

Google AppEngine Enhancer: at java.lang.ClassLoader.defineClass1(Native Method)

 

The problem is that the enhancer process needs some JARs in the classpath, this is how I got it working in MAVEN (you can see how I added dependencies to be used when running the enhacenment step):

 

...

                    <plugin>

                        <groupId>org.datanucleus</groupId>

                        <artifactId>maven-datanucleus-plugin</artifactId>

                        <version>3.1.3</version>

                        <configuration>

                            <persistenceUnitName>default</persistenceUnitName>

                            <api>JPA</api>

                            <fork>false</fork>

                            <verbose>true</verbose>

                        </configuration>

                        <executions>

                            <execution>

                                <phase>process-classes</phase>

                                <goals>

                                    <goal>enhance</goal>

                                </goals>

                            </execution>

                        </executions>

                        <dependencies>

                            <dependency>

                                <groupId>com.google.appengine.orm</groupId>

                                <artifactId>datanucleus-appengine</artifactId>

                                <version>2.1.2</version>

                            </dependency>

                            <dependency>

                                <groupId>org.datanucleus</groupId>

                                <artifactId>datanucleus-api-jpa</artifactId>

                                <version>3.1.3</version>

                            </dependency>

                            <dependency>

                                <groupId>javax.jdo</groupId>

                                <artifactId>jdo-api</artifactId>

                                <version>3.0.1</version>

                            </dependency>

                            <dependency>

                                <groupId>org.datanucleus</groupId>

                                <artifactId>datanucleus-core</artifactId>

                                <version>3.1.3</version>

                            </dependency>

                            <dependency>

                                <groupId>org.datanucleus</groupId>

                                <artifactId>datanucleus-enhancer</artifactId>

                                <version>3.1.1</version>

                            </dependency>

                        </dependencies>

                    </plugin>

...

 

So, finally, my question: how can I add those dependencies to JAVA CLASSPATH for the IntelliJ/GAE enhancer process?


Viewing all articles
Browse latest Browse all 5661

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>