spring4 + jpa上的应用程序已部署在Websphere上 尝试在服务器上停止和启动应用程序时,日志中会显示错误消息:
有来自Websphere应用程序服务器的错误消息日志:
[2/11/19 15:22:43:087 MSK] 000000ae SystemErr R [CompoundClassLoader@c29c9165] error can't determine implemented interfaces of missing type javax.persistence.NamedStoredProcedureQuery
when weaving type org.springframework.data.jpa.repository.query.StoredProcedureAttributeSource
when weaving classes
when weaving
[Xlint:cantFindType]
[2/11/19 15:22:43:918 MSK] 000000ae SystemErr R [CompoundClassLoader@c29c9165] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
[2/11/19 15:26:32:831 MSK] 000000ae SystemErr R [CompoundClassLoader@c29c9165] error can't determine implemented interfaces of missing type javax.persistence.EntityGraph
when weaving type org.springframework.data.jpa.repository.query.Jpa21Utils
when weaving classes
when weaving
您能提示我,这个错误怎么办?
我的pom.xml是:
我认为,这个问题与jpa有关联
...
<packaging>war</packaging>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.3.13.RELEASE</spring.version>
<javax.servlet>3.0.1</javax.servlet>
<hb.enity.manager>4.2.21.Final</hb.enity.manager>
<spring.test>3.2.4.RELEASE</spring.test>
<junit.version>4.11</junit.version>
<slf4j.version>1.7.25</slf4j.version>
<log4j.version>1.2.17</log4j.version>
</properties>
<build>
<finalName>myAPP</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<testSourceDirectory>src/test</testSourceDirectory>
</build>
<dependencies>
<!--SPRING-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.11.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<!-- SERVLET-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet}</version>
<scope>provided</scope>
</dependency>
<!--JACKSON AND XML-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!--DATABASE-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.oracle.odb</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2.0</version>
</dependency>
<!--APACHE-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<!--TEST-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
</dependency>
<!--LOG4J-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
</project>
websphere版本8.5.5.13 春天4 数据库是oracle 11g
我的一个JPA实体是
@Entity
@Audited
@Table(name = "UserRecord", uniqueConstraints = {
@UniqueConstraint(columnNames = {"name", "surname", "UserType"})})
@NoArgsConstructor(access = AccessLevel.PUBLIC)
@AllArgsConstructor
@Getter
@Setter
@Access(AccessType.FIELD)
public class UserRecord {
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
@Column(name = "PR_KEY")
private String prKey;
//Business Key
@Column(name = "name", length = 100, unique = false)
private String name;
//Business Key
@Column(name = "surname", length = 100, nullable = false)
private String surname;
//Business Key
@Column(name = "UserType", length = 100, nullable = false)
private String UserType;
@Version
private int version;
@Column(name = "User", length = 100000)
@Lob
private byte[] User;
public UserRecord(String name, String surname, String UserType, byte[] User) {
this.name = name;
this.surname = surname;
this.UserType = UserType;
this.User = User;
}
}