Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Eclipselink runs in debug but fails in deployed jar - IllegalArgumentException: eclipselink.tolerate(Persistence unit not initializing when I deploy to a jar. Internal Exception: java.lang.IllegalArgumentException: eclipselink.tolerate-invalid-jpql)
Eclipselink runs in debug but fails in deployed jar - IllegalArgumentException: eclipselink.tolerate [message #1693044] Tue, 21 April 2015 12:22 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
I am using Eclipse Texo for my JPA classes. The application runs in the Eclipse IDE. It is a maven project and I Update my eclipse project using maven. The exception states a eclipselink.tolerate-invalid-jpql as an invalid argument. When I search all files in my workspace for "tolerate-invalid-jpql" it is not found, a bit worrying. Since I cannot even find where this property is set in the eclipselink jar and I am not setting it I am at a loss to know where to look next.

Exception in thread "main" Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptio
ns.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launc
her$AppClassLoader@4d68af51
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services
- 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [pssh2] failed.
Internal Exception: java.lang.IllegalArgumentException: eclipselink.tolerate-invalid-jpql
        at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(
PersistenceUnitLoadingException.java:127)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:111)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:183)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
        at com.example.pss.PssServer.main(PssServer.java:53)


I am using the maven shade plugin to eliminate duplicate class and build a uber jar. Here are the relevant parts

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">	<modelVersion>4.0.0</modelVersion>
	<groupId>PSS</groupId>
	<artifactId>PSS</artifactId>
	<name>ParcelSimulationSystem</name>
	<version>0.0.1-SNAPSHOT</version>
	<build>
		<sourceDirectory>src/main</sourceDirectory>
		<testSourceDirectory>src/test</testSourceDirectory>
		<outputDirectory>target/classes</outputDirectory>
		<testOutputDirectory>target/test-classes</testOutputDirectory>
		<resources>
	        <resource>
	            <directory>src-gen</directory>
	            <includes>
	                <include>**/*.ecore</include>
	            </includes>
	        </resource>
   			<resource>
				<directory>src/main</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<directory>target</directory>
		<finalName>${project.artifactId}-${project.version}</finalName>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>build-helper-maven-plugin</artifactId>
										<versionRange>[1.7,)</versionRange>
										<goals>
											<goal>add-source</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
            <plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
   					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src-gen</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>1.7</version>
				<configuration>
					<createDependencyReducedPom>true</createDependencyReducedPom>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<transformers>
								<transformer
									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<manifestEntries>
										<Main-Class>com.example.pss.PssServer</Main-Class>
									</manifestEntries>
								</transformer>
 							</transformers>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<repositories>
		<repository>
			<id>sonatype-oss-public</id>
			<url>https://oss.sonatype.org/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
        <repository>
           <id>repo2_maven_org</id>
           <url>http://repo2.maven.org/maven2</url>
        </repository>
  		<repository>
			<id>typesafe</id>
			<name>Typesafe Repository</name>
			<url>http://repo.typesafe.com/typesafe/releases/</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>${jettyVersion}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
			<version>${jettyVersion}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-util</artifactId>
			<version>${jettyVersion}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-server</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.containers</groupId>
			<artifactId>jersey-container-servlet-core</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.containers</groupId>
			<artifactId>jersey-container-jetty-http</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-moxy</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>persistence-api</artifactId>
			<version>1.0.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<version>1.1</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.common</artifactId>
			<version>2.10.1.v20140901-1043</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.ecore</artifactId>
			<version>2.10.1.v20140901-1043</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
			<version>2.10.1.v20140901-1043</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.texo</artifactId>
			<version>0.9.0.v201502181451</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.texo.server</artifactId>
			<version>0.9.0.v201502181451</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.texo.xml</artifactId>
			<version>0.9.0.v201502181451</version>
		</dependency>
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>javax.persistence</artifactId>
			<version>2.1.0.v201304241213</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>eclipselink</artifactId>
			<version>2.6.0</version>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.4.186</version>
		</dependency>
	</dependencies>
	<properties>
		<jettyVersion>9.2.9.v20150224</jettyVersion>
		<jersey.version>2.17</jersey.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
</project>


Any ideas?
Re: Eclipselink runs in debug but fails in deployed jar - IllegalArgumentException: eclipselink.tole [message #1693061 is a reply to message #1693044] Tue, 21 April 2015 13:38 Go to previous messageGo to next message
Rick Curtis is currently offline Rick CurtisFriend
Messages: 24
Registered: September 2014
Location: Rochester, MN
Junior Member
I'm not entirely sure what the solution is, but the exception is happening because you have a mixture of EclipseLink binaries on your classpath. I bet that somehow you're loading a downlevel org.eclipse.persistence.core jar along with an uplevel org.eclipse.persistence.jpa jar.

Start by taking a hard look at your dependencies.

Thanks,
Rick
Re: Eclipselink runs in debug but fails in deployed jar - IllegalArgumentException: eclipselink.tole [message #1693080 is a reply to message #1693061] Tue, 21 April 2015 14:42 Go to previous message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
I did mvn depenency:tree here is the relevant part:

[INFO] +- org.glassfish.jersey.media:jersey-media-moxy:jar:2.17:compile
[INFO] |  +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.17:compile
[INFO] |  +- org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.5.0:compile
[INFO] |  |  \- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.5.0:compile
[INFO] |  |     \- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.5.0:compile
[INFO] |  \- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.5.0:compile


I was also using eclipselink 2.6.0 as the dependency in my pom.xml. The exception thrown is completely useless then, hmm

DLL Hell is alive and kicking.

Thx for the guidance.
Previous Topic:Ripple Load across optional ManyToOne using EclipseLink 2.6.0
Next Topic:Moxy marshalling removes xsi namespace definitions
Goto Forum:
  


Current Time: Sun Oct 13 04:35:46 GMT 2024

Powered by FUDForum. Page generated in 0.03512 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top