我試圖部署Java Play! 2申請。 My Bamboo服務器正在運行play clean dist
,它們生成一個包含已部署應用程序的zip文件。 Bamboo然後解壓縮該文件,並將符號(命名爲當前)鏈接更改爲此新文件夾。在特定情況下出現java.lang.IncompatibleClassChangeError
然後,手動(現在)我要運行腳本start
而是java.lang.IncompatibleClassChangeError
拋出異常:
root # pwd
/home/webserver/current/
root # ./start
Play server process ID is 9795
[info] play - datasource [jdbc:mysql://XXX/XXX] bound to JNDI as DefaultDS
[debug] c.j.b.BoneCPDataSource - JDBC URL = jdbc:mysql://XXX/XXX, Username = lmc, artitions = 3, max (per partition) = 5, min (per partition) = 2, helper threads = 3, idle max ge = 10 min, idle test period = 5 min
[info] play - database [default] connected at jdbc:mysql://XXX/XXX
Oops, cannot start the server.
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at play.db.jpa.JPAPlugin.onStart(JPAPlugin.java:35)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at play.api.Play$.start(Play.scala:60)
at play.core.StaticApplication.<init>(ApplicationProvider.scala:51)
at play.core.server.NettyServer$.createServer(NettyServer.scala:133)
at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:162)
at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:161)
at scala.Option.map(Option.scala:133)
at play.core.server.NettyServer$.main(NettyServer.scala:161)
at play.core.server.NettyServer.main(NettyServer.scala)
我讀過很多關於這個錯誤,但沒有任何職位都可以解決我的問題的權利現在。我試着將文件夾複製到另一個地方,就像這樣:
root # cp -r /home/webserver/current /root/webserver-current
root # cd /root/webserver-current
root # ./start
在這裏,而不是例外,我的應用程序的工作! :-O 我的結論是,它不適用於/home
分區,但我不敢相信! 你有任何想法或任何解決方案,使其工作?
Regards, Samuel。
感謝您的回答。我正在運行「clean dist」來重新編譯我的整個應用程序。此外,同樣的軟件包正在其他分區上工作,正如我在最後所說的那樣... –
@SamuelROZE不會更改我的答案。如果你有這種例外,那就是原因。尋找錯誤的「乾淨構建」,錯誤的部署等。 – EJP