java - Error creating entityManagerFactory due to error tying to scan -
java - Error creating entityManagerFactory due to error tying to scan <jar-file> -
i next http://spring.io/guides/tutorials/data/3 ; not sure did wrong, maintain on getting exceptions don't understand. tried searching questions same exceptions no avail.
stack trace: http://pastebin.com/wypqs6da
persistenceconfig.java
@configuration @enablejparepositories @enabletransactionmanagement public class persistenceconfig { @bean public datasource datasource() throws sqlexception { embeddeddatabasebuilder builder = new embeddeddatabasebuilder(); homecoming builder.settype(embeddeddatabasetype.hsql).build(); } @bean public entitymanagerfactory entitymanagerfactory() throws sqlexception { hibernatejpavendoradapter vendoradapter = new hibernatejpavendoradapter(); vendoradapter.setdatabase(database.hsql); vendoradapter.setgenerateddl(true); localcontainerentitymanagerfactorybean mill = new localcontainerentitymanagerfactorybean(); factory.setjpavendoradapter(vendoradapter); factory.setpackagestoscan("com.scrumster.persistence.domain"); factory.setdatasource(datasource()); factory.afterpropertiesset(); homecoming factory.getobject(); } @bean public entitymanager entitymanager(entitymanagerfactory entitymanagerfactory) { homecoming entitymanagerfactory.createentitymanager(); } @bean public platformtransactionmanager transactionmanager() throws sqlexception { jpatransactionmanager txmanager = new jpatransactionmanager(); txmanager.setentitymanagerfactory(entitymanagerfactory()); homecoming txmanager; } @bean public hibernateexceptiontranslator hibernateexceptiontranslator() { homecoming new hibernateexceptiontranslator(); } }
build.gradle:
apply plugin: 'war' apply plugin: 'tomcat' apply plugin: 'java' apply plugin: 'propdeps' apply plugin: 'propdeps-maven' apply plugin: 'propdeps-idea' apply plugin: 'propdeps-eclipse' apply plugin: 'eclipse' apply plugin: 'idea' buildscript { repositories { mavencentral() maven { url "http://download.java.net/maven/2" } maven { url 'http://repo.spring.io/plugins-release' } } dependencies { classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:0.9.8' classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.1' } } repositories { mavencentral() maven { url 'http://repo.spring.io/milestone/'} } dependencies { def tomcatversion = '7.0.42' tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatversion}", "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatversion}" tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatversion}") { exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' } compile 'org.springframework:spring-webmvc:4.0.5.release' compile 'org.springframework.data:spring-data-jpa:1.3.4.release' compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.final' compile 'org.hibernate:hibernate-entitymanager:4.0.1.final' compile 'org.springframework.hateoas:spring-hateoas:0.7.0.release' compile 'com.jayway.jsonpath:json-path:0.8.1' compile 'org.springframework.security:spring-security-web:3.2.0.m2' compile 'org.springframework.security:spring-security-core:3.2.0.m2' compile 'org.springframework.security:spring-security-config:3.2.0.m2' compile 'org.slf4j:slf4j-api:1.7.5' runtime 'org.hsqldb:hsqldb:2.3.2' runtime 'org.slf4j:slf4j-jdk14:1.7.5' runtime 'com.fasterxml.jackson.core:jackson-databind:2.3.3' runtime 'javax.xml.bind:jaxb-api:2.2.9' provided 'javax.servlet:javax.servlet-api:3.0.1' testcompile 'com.jayway.jsonpath:json-path-assert:0.8.1' testcompile 'org.springframework:spring-test:4.0.5.release' testcompile 'junit:junit:4.11' testcompile "org.mockito:mockito-core:1.9.5" } task wrapper(type: wrapper) { gradleversion = '1.12' } tomcatrunwar.contextpath = ''
stacktrace:
caused by: java.lang.runtimeexception: error while reading file:/e:/files/source/workspace-eclipse2/scrumster/bin/ @ org.hibernate.ejb.packaging.nativescanner.getfilesinjar(nativescanner.java:193) @ org.hibernate.ejb.ejb3configuration.addscannedentries(ejb3configuration.java:503) @ org.hibernate.ejb.ejb3configuration.scanforclasses(ejb3configuration.java:851) ... 58 more caused by: java.io.ioexception: invalid constant type: 18 @ javassist.bytecode.constpool.readone(constpool.java:1113) @ javassist.bytecode.constpool.read(constpool.java:1056) @ javassist.bytecode.constpool.<init>(constpool.java:150) @ javassist.bytecode.classfile.read(classfile.java:765) @ javassist.bytecode.classfile.<init>(classfile.java:109)
i hope point me right source, or help me in predicament.
the error:
invalid constant type: 18
indicates have built jars java 8, attempting run application in lower version.
from have seen elsewhere, need switch newer version of javassist (which raising error), version using not compatible java 8.
java spring gradle
Comments
Post a Comment