java - Strange JPA compilation errors -
i following compile errors when trying use jpa 2.1 , eclipselink 2.6
em.getcriteriabuilder()
java: cannot find symbol symbol: method getcriteriabuilder() location: variable em of type javax.persistence.entitymanager
expression<boolean>
java: type javax.persistence.criteria.expression not take parameters
typedquery<foo> query = em.createquery(querystring, foo.class);
java: method createquery in interface javax.persistence.entitymanager cannot applied given types; required: java.lang.string found: java.lang.string,java.lang.class reason: actual , formal argument lists differ in length
my pom.xml contains following dependencies jpa
<dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>javax.persistence</artifactid> <version>2.1.0</version> </dependency> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>eclipselink</artifactid> <version>2.6.0</version> </dependency>
i can think compiler using different jpa version such methods trying use above did not exist. pom contains 2.1 implementation.
these compilation errors happening while attempting convert non maven project intellij idea maven project (so worked before).
full pom.xml
<?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/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <packaging>war</packaging> <version>0.0.1-snapshot</version> <groupid>redacted</groupid> <artifactid>redacted</artifactid> <properties> <appengine.app.version>1</appengine.app.version> <appengine.target.version>1.7.5</appengine.target.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <dependencies> <!-- compile/runtime dependencies --> <dependency> <groupid>com.google.appengine</groupid> <artifactid>appengine-api-1.0-sdk</artifactid> <version>${appengine.target.version}</version> </dependency> <dependency> <groupid>javax.servlet</groupid> <artifactid>servlet-api</artifactid> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupid>jstl</groupid> <artifactid>jstl</artifactid> <version>1.2</version> </dependency> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>javax.persistence</artifactid> <version>2.1.0</version> </dependency> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>eclipselink</artifactid> <version>2.6.0</version> </dependency> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.1.6</version> </dependency> <dependency> <groupid>javax.ws.rs</groupid> <artifactid>javax.ws.rs-api</artifactid> <version>2.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.glassfish.jersey.containers</groupid> <!-- if container implements servlet api older 3.0, use "jersey-container-servlet-core" --> <artifactid>jersey-container-servlet</artifactid> <version>2.17</version> </dependency> <dependency> <groupid>org.glassfish.jersey.ext</groupid> <artifactid>jersey-mvc</artifactid> <version>2.17</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-core</artifactid> <version>2.5.1</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-databind</artifactid> <version>2.5.1</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-annotations</artifactid> <version>2.5.1</version> </dependency> <dependency> <groupid>org.springframework.security</groupid> <artifactid>spring-security-web</artifactid> <version>3.2.6.release</version> </dependency> <!-- test dependencies --> <dependency> <groupid>com.google.appengine</groupid> <artifactid>appengine-testing</artifactid> <version>${appengine.target.version}</version> <scope>test</scope> </dependency> <dependency> <groupid>com.google.appengine</groupid> <artifactid>appengine-api-stubs</artifactid> <version>${appengine.target.version}</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <version>2.5.1</version> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.3</version> <configuration> <archiveclasses>true</archiveclasses> <webresources> <!-- in order interpolate version pom appengine-web.xml --> <resource> <directory>${basedir}/src/main/webapp/web-inf</directory> <filtering>true</filtering> <targetpath>web-inf</targetpath> </resource> </webresources> </configuration> </plugin> <plugin> <groupid>com.google.appengine</groupid> <artifactid>appengine-maven-plugin</artifactid> <version>${appengine.target.version}</version> </plugin> </plugins> </build>
edit: result of running mvn dependency:tree
[info] --- maven-dependency-plugin:2.1:tree (default-cli) @ redacted --- [info] redacted:war:0.0.1-snapshot [info] +- com.google.appengine:appengine-api-1.0-sdk:jar:1.7.5:compile [info] +- javax.servlet:servlet-api:jar:2.5:provided (scope not updated compile) [info] +- jstl:jstl:jar:1.2:compile [info] +- org.eclipse.persistence:javax.persistence:jar:2.1.0:compile [info] +- org.eclipse.persistence:eclipselink:jar:2.6.0:compile [info] | +- org.eclipse.persistence:commonj.sdo:jar:2.1.1:compile [info] | +- javax.validation:validation-api:jar:1.1.0.final:compile [info] | \- org.glassfish:javax.json:jar:1.0.4:compile [info] +- mysql:mysql-connector-java:jar:5.1.6:compile [info] +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:provided (scope not updated compile) [info] +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.17:compile [info] | +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.17:compile [info] | | \- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b10:compile [info] | +- org.glassfish.jersey.core:jersey-common:jar:2.17:compile [info] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile [info] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.17:compile [info] | | +- org.glassfish.hk2:hk2-api:jar:2.4.0-b10:compile [info] | | | +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b10:compile [info] | | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b10:compile [info] | | +- org.glassfish.hk2:hk2-locator:jar:2.4.0-b10:compile [info] | | | \- org.javassist:javassist:jar:3.18.1-ga:compile [info] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile [info] | \- org.glassfish.jersey.core:jersey-server:jar:2.17:compile [info] | +- org.glassfish.jersey.core:jersey-client:jar:2.17:compile [info] | \- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.17:compile [info] +- org.glassfish.jersey.ext:jersey-mvc:jar:2.17:compile [info] +- com.fasterxml.jackson.core:jackson-core:jar:2.5.1:compile [info] +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.1:compile [info] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.1:compile [info] +- org.springframework.security:spring-security-web:jar:3.2.6.release:compile [info] | +- aopalliance:aopalliance:jar:1.0:compile [info] | +- org.springframework.security:spring-security-core:jar:3.2.6.release:compile [info] | | \- org.springframework:spring-aop:jar:3.2.8.release:compile [info] | +- org.springframework:spring-beans:jar:3.2.8.release:compile [info] | +- org.springframework:spring-context:jar:3.2.8.release:compile [info] | +- org.springframework:spring-core:jar:3.2.8.release:compile [info] | +- org.springframework:spring-expression:jar:3.2.8.release:compile [info] | \- org.springframework:spring-web:jar:3.2.8.release:compile [info] +- com.google.appengine:appengine-testing:jar:1.7.5:test [info] \- com.google.appengine:appengine-api-stubs:jar:1.7.5:test [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------
i believe google app engine , maven facets of intellij idea incompatible. chose create project skeleton-archetype of com.google.appengine.archetypes , ignored gae ide integration feature. solved compliation errors.
Comments
Post a Comment