2012-01-20 3 views
0
Model/My_Table_Name.java 

/* 
* To change this template, choose Tools | Templates 
* and open the template in the editor. 
*/ 
package models; 

import java.util.*; 
import javax.persistence.*; 
import play.db.jpa.*; 



@Entity 
@Table(name="My_Table_Name") 
public class My_Table_Name extends Model{ 
    public int rid; 
    public boolean siteEnabled; 
    public String finalUrl; 
    public String errorUrl; 
    public boolean tokenRequired; 

    public My_Table_Name(int rid,boolean siteEnabled, 
      String finalUrl, String errorUrl, boolean tokenRequired) 
    { 
     this.rid = rid; 
     this.errorUrl = errorUrl; 
     this.finalUrl = finalUrl; 

     this.siteEnabled = siteEnabled; 
     this.tokenRequired = tokenRequired; 
    } 

} 

컨트롤러/application.java아차 :있는 IncompatibleClassChangeError - playframework

@Before 
    static void doSomething() 
    { 
     List<My_Table_Name> config = My_Table_Name.findAll(); 
     redirect(config.get(0).finalUrl); 

    } 

오류 :

Oops: IncompatibleClassChangeError 

An unexpected error occured caused by exception IncompatibleClassChangeError: 
Implementing class 

스택 트레이스 :

Oops: IncompatibleClassChangeError 
An unexpected error occured caused by exception IncompatibleClassChangeError: Implementing class 

play.exceptions.UnexpectedException: Unexpected Error 
    at play.Invoker$Invocation.onException(Invoker.java:244) 
    at play.Invoker$Invocation.run(Invoker.java:286) 
    at Invocation.HTTP Request(Play!) 
Caused by: java.lang.IncompatibleClassChangeError: Implementing class 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) 
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615) 
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) 
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) 
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306) 
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 
    at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:129) 
    at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java:118) 
    at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:480) 
    at play.Play.start(Play.java:515) 
    at play.Play.detectChanges(Play.java:618) 
    at play.Invoker$Invocation.init(Invoker.java:198) 
    ... 1 more 

위 내 코드입니다 그리고 난 다음입니다 테스트와 YABE 튜토리얼을위한 가이드 Post 클래스에 대해서는,하지만 mysql db에 내 자신의 기존 테이블을 사용할 수 있다고 생각했습니다.

+0

노력하고 있습니다? 어떤 Java 버전을 사용하고 있습니까? ('java -version'실행) – digiarnie

답변

0

이 항목을 선택했습니다. 난 내 프로젝트에 대한 의존성을 실행 분명히 할 때, 그것은 최대 절전 모드의 이전 버전을 가져와 클래스 경로에서이 최대 절전 모드에 대한 참조, 내 lib 폴더

과 놀이의 하나

한 \ lib 폴더

이 있었다

나는 내 응용 프로그램의 \ lib 디렉토리 폴더에서 최대 절전 모드 *의 .JAR을 제거하고 가지 재생 서버가 해당 모델 클래스와 @Before 코드없이 시작 않습니다