[SPRING] 오류 : Spring 컨트롤러를 사용하는 javax.persistence.JoinColumn.foreignKey () Ljavax / persistence / ForeignKey
SPRING오류 : Spring 컨트롤러를 사용하는 javax.persistence.JoinColumn.foreignKey () Ljavax / persistence / ForeignKey
나는 Spring MVC로 작성되고 Hibernate를 사용하는 간단한 두 개의 테이블 애플리케이션을 가지고있다. 모든 것이 완벽하게 작동하지만 컨트롤러의 하나만 테스트하면 다음과 같은 메시지가 나타납니다.
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
단위 테스트 방법은 다음과 같습니다.
@RunWith(value=SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration("file:C:/NetBeansProjects/Library/build/web/WEB-INF/library- servlet.xml")
public class TestPersonController {
@Autowired
private PersonService personService;
@Autowired
private WebApplicationContext wac;
private MockMvc mockMvc;
@Before
public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
}
@Test
public void testGetProfile() {
Person mockPerson = new Person();
mockPerson.setPersonId(1);
mockPerson.setName("Mr Brown");
mockPerson.setAddress("Utopia Planitia on Mars");
mockPerson.setTelephone("1234567890");
mockPerson.setEmail("brown@brown.com");
when(personService.get(1)).thenReturn(mockPerson);
try {
mockMvc.perform(get("/person/profile?personId=1"))
.andExpect(status().isOk())
.andExpect(view().name("view/profile"))
.andExpect(forwardedUrl("/WEB-INF/jsp/view/profile.jsp"))
.andExpect(model().attribute("person", hasSize(1)))
.andExpect(model().attribute("person", hasItem(
allOf(
hasProperty("personId", is(1)),
hasProperty("name", is("Mr Brown")),
hasProperty("address", is("53 Onslow Gardens")),
hasProperty("telephone", is("1234567890")),
hasProperty("email", is("brown@brown.com"))
)
)));
}
catch(Exception e) {
Misc.printStackTrace(e);
}
verify(personService, times(1)).get(1);
verifyNoMoreInteractions(personService);
}
}
응용 프로그램의 모델을 구성하는 두 클래스는 1 : M 관계를 통해 조인됩니다. 첫 번째 테이블 Person은 다음을가집니다.
@Id
@Column(name="PERSON_ID", unique=true, nullable=false)
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer personId;
@Column(name="NAME", nullable=false, length=50)
private String name;
@Column(name="ADDRESS", nullable=false, length=100)
private String address;
@Column(name="TELEPHONE", nullable=false, length=10)
private String telephone;
@Column(name="EMAIL", nullable=false, length=50)
private String email;
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="person")
@JsonManagedReference
private List<Book> books;
두 번째 테이블은 다음과 같습니다.
@Id
@Column(name="BOOK_ID", unique=true, nullable=false)
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer bookId;
@Column(name="AUTHOR", nullable=false, length=50)
private String author;
@Column(name="TITLE", nullable=false, length=50)
private String title;
@Column(name="DESCRIPTION", nullable=false, length=500)
private String description;
@Column(name="ONLOAN", nullable=false)
private boolean onLoan;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="person_id")
@JsonBackReference
private Person person;
이 클래스는 Person 컨트롤러의 메소드에 대한 새로운 단위 테스트를 제외하고는 다른 모든 환경에서 올바르게 작동합니다.
클래스에 @ForeignKey 주석을 사용하지 않아도됩니다. 자바를 사용하지 않아도된다고 생각하기 때문에 필요하지 않습니다.
의존성 문제가 있습니까?
단위 테스트 스택 추적은 다음과 같습니다.
Testsuite: library.person.TestPersonController
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.085 sec
------------- Standard Error -----------------
log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
------------- ---------------- ---------------
Testcase: testGetProfile(library.person.TestPersonController): Caused an ERROR
Failed to load ApplicationContext
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:155)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:100)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:212)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private library.service.PersonService library.controller.admin.AdminController.personService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private library.dao.PersonDAOImpl library.service.PersonService.personDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory library.dao.PersonDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContext(AbstractGenericWebContextLoader.java:129)
at org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContext(AbstractGenericWebContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private library.service.PersonService library.controller.admin.AdminController.personService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private library.dao.PersonDAOImpl library.service.PersonService.personDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory library.dao.PersonDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private library.dao.PersonDAOImpl library.service.PersonService.personDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory library.dao.PersonDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:957)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private library.dao.PersonDAOImpl library.service.PersonService.personDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory library.dao.PersonDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory library.dao.PersonDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:957)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory library.dao.PersonDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:C:/NetBeansProjects/Library/build/web/WEB-INF/library-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:957)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:855)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:2881)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1795)
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3788)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3742)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:343)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:431)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:416)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
Test library.person.TestPersonController FAILED
소품 파일 설정 :
<!-- Spring Properties file for Library. -->
<bean id="propertiesFactory" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location">
<value>/WEB-INF/library.properties</value>
</property>
</bean>
해결법
-
==============================
1.JoinColumn.foreignKey ()는 버전 4.3까지 Hibernate 4에 의해 구현되지 않은 JPA 2.1에서 소개되었습니다. 이전 버전의 Hibernate 4를 사용하고 있다면 4.3.x로 업그레이드하십시오.
JoinColumn.foreignKey ()는 버전 4.3까지 Hibernate 4에 의해 구현되지 않은 JPA 2.1에서 소개되었습니다. 이전 버전의 Hibernate 4를 사용하고 있다면 4.3.x로 업그레이드하십시오.
이미 Hibernate 4.3을 사용하고 있다면 JPA 2.1을 사용하여 API와 구현이 일치하는지 확인하십시오.
-
==============================
2.JBoss EAP 6.4.x에있는 경우
JBoss EAP 6.4.x에있는 경우
JPA 2.0과 함께 제공 될 가능성이 있으며 수동으로 2.1로 업데이트해야합니다! 나를 위해 일한 간단한 단계를 따르십시오.
maven 저장소에서 JPA 2.1을 다운로드하고 JBoss 모듈을 업데이트하십시오. http://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api
파일을 JBoss modules 디렉토리에 복사하십시오.
동일한 디렉토리에서 module.xml을 업데이트하십시오.
-
==============================
3.다른 해결 방법은 https://issues.jboss.org/browse/WFCORE-209에서 찾을 수 있습니다.
다른 해결 방법은 https://issues.jboss.org/browse/WFCORE-209에서 찾을 수 있습니다.
해결 방법 1 javaee / api / main.module.xml을 다음과 같이 업데이트하십시오.
<!--<module name="javax.persistence.api" export="true"/>--> <module name="javax.persistence.api" export="false"/>
이것은 휴대용이 아니지만.
해결 방법 2
다음과 같이 jboss-deployment-structure.xml을 업데이트하십시오.
<?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure> <deployment> <exclude-subsystems> <subsystem name="jpa" /> </exclude-subsystems> <exclusions> <!-- WFCORE-209 workaround --> <module name="javaee.api" /> <!-- --------------------- --> <module name="javax.persistence.api" /> <module name="org.hibernate" /> </exclusions> <dependencies> <!-- WFCORE-209 workaround --> <module name="javax.activation.api" export="true"/> <module name="javax.annotation.api" export="true"/> <module name="javax.ejb.api" export="true"/> <module name="javax.el.api" export="true"/> <module name="javax.enterprise.api" export="true"/> <module name="javax.enterprise.deploy.api" export="true"/> <module name="javax.inject.api" export="true"/> <module name="javax.interceptor.api" export="true"/> <module name="javax.jms.api" export="true"/> <module name="javax.jws.api" export="true"/> <module name="javax.mail.api" export="true"/> <module name="javax.management.j2ee.api" export="true"/> <!-- <module name="javax.persistence.api" export="true"/> --> <module name="javax.resource.api" export="true"/> <module name="javax.rmi.api" export="true"/> <module name="javax.security.auth.message.api" export="true"/> <module name="javax.security.jacc.api" export="true"/> <module name="javax.servlet.api" export="true"/> <module name="javax.servlet.jsp.api" export="true"/> <module name="javax.transaction.api" export="true"/> <module name="javax.validation.api" export="true"/> <module name="javax.ws.rs.api" export="true" services="export"/> <module name="javax.xml.bind.api" export="true"/> <module name="javax.xml.registry.api" export="true"/> <module name="javax.xml.soap.api" export="true"/> <module name="javax.xml.ws.api" export="true"/> <!-- This one always goes last. --> <module name="javax.api" export="true"/> <!-- --------------------- --> </dependencies> </deployment> </jboss-deployment-structure>
이것은 완전히 이식 가능하다.
-
==============================
4.나는이 비슷한 문제를 마침내 해결했다. 나의 lib 폴더에 구 버전 (hibernate-jpa-2.0-api-1.0.0-Final.jar)이 있는데, 나는 Maven 의존성이 로딩되는 것을 막았다.
나는이 비슷한 문제를 마침내 해결했다. 나의 lib 폴더에 구 버전 (hibernate-jpa-2.0-api-1.0.0-Final.jar)이 있는데, 나는 Maven 의존성이 로딩되는 것을 막았다.
그래서 수동으로 삭제하고 (hibernate-jpa-2.1-api-1.0.0-Final.jar) 추가하면 모든 것이 작동하기 시작합니다.
from https://stackoverflow.com/questions/24588860/error-javax-persistence-joincolumn-foreignkeyljavax-persistence-foreignkey-wi by cc-by-sa and MIT license
'SPRING' 카테고리의 다른 글
[SPRING] Spring과 Abstract 클래스 - 추상 클래스에서 속성 삽입 (0) | 2019.01.23 |
---|---|
[SPRING] TestContextBootstrapper를로드 할 수 없음 - 스프링 유닛 테스트 (0) | 2019.01.23 |
[SPRING] 봄 주석이 작동하지 않는다. (0) | 2019.01.23 |
[SPRING] 봄 부팅 CSS 빈 / 모든 것을 시도한 후에 로딩하지 않는 것을 보여주는 (0) | 2019.01.23 |
[SPRING] loginService가 null 인 이유는 무엇입니까? (0) | 2019.01.23 |