2016-07-09 7 views
1

私は自分のlocalhostからnetbeansで安心してサービスを提供しました。私はglassfish 4.1.1を私のウェブサーバー として選択しました。 それは私にXML応答を与えたいと思ったが、私はJSONレスポンスを取得しようとしたとき、それは私がウェブ上で検索し、スタックjava rest serviceでjsonを取得しています

GET RequestFailed RequestFailed --> Status: (500) 
Response: { 

HTTP Status 500 - Internal Server Error 


type Exception report 

messageInternal Server Error 

descriptionThe server encountered an internal error that prevented it from fulfilling this request. 

exception 
javax.servlet.ServletException: javax.ejb.EJBException 


root cause 
javax.ejb.EJBException 


root cause 
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException 
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
Error Code: 0 


root cause 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException 
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 
Error Code: 0 


root cause 
java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
javax.resource.spi.ResourceAllocationException: Error in allocating a connection. Cause: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 


root cause 
java.net.ConnectException: Connection refused: connect 


note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs. 


GlassFish Server Open Source Edition 4.1.1 

} 

次のように私に500エラーを与えたとのために、それはoccursedことを見たときに、それが働いていましたEclipseLinkのは、私はEclipseLinkを2.6.3と2.6.1でそれをテストし、私はlocalhostを再インストールしたが、再びエラーを得た:私の悪い英語 ため

GET RequestFailed RequestFailed --> Status: (500) 
Response: { 
HTTP Status 500 - Internal Server Error 

type Exception report 

messageInternal Server Error 

descriptionThe server encountered an internal error that prevented it from fulfilling this request. 

exception 

javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.persistence.jaxb.BeanValidationHelper 
root cause 

org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.persistence.jaxb.BeanValidationHelper 
root cause 

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.persistence.jaxb.BeanValidationHelper 
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs. 

GlassFish Server Open Source Edition 4.1.1 


} 

気の毒とさえ私の問題のためにあなたの時間を置くためにあなたをとても感謝しますもしそれを読んだら。

+0

サーバーから関連コードを投稿できますか? –

答えて

1

スタックトレースは、コードがjava.lang.NoClassDefFoundErrorの

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.persistence.jaxb.BeanValidationHelper

で失敗していることを示しているがorg.eclipse.persistence.jaxb.BeanValidationHelperクラスdependecyが実行時に存在していることを確認してください。

あなたは================================== How to solve java.lang.NoClassDefFoundError?

@ NoClassDefFoundErrorが詳細を読むことができます======================= 更新:

GlassFish 4.1.1のバグがあるようです。 JIRAはまだ開かれていますhttps://java.net/jira/browse/GLASSFISH-21440です。ジャージーには1つのJIRAがあります。https://java.net/jira/browse/JERSEY-2888もあります。最後に、彼らは問題のいくつかの回避策を提供しました。その回避策をverfiyしてください。大胆かつ明確なソリューションを作るための

+0

のnetbeanse安らかなプロジェクト私はweb.pomがありません どのように動作するはずですか? –

+0

GlassFish 4.1.1にバグがあるようです。 JIRAは引き続きOPEN https://java.net/jira/browse/GLASSFISH-21440です。私は私の答えを更新しました。 https://java.net/jira/browse/JERSEY-2888で述べられている問題を回避できるようになることを願っています。 –

+0

はい、4.1.1の約1歳のバグです 私のグラスフィッシュを4.1に変更し、すべて正常に動作します ありがとうございました –

1

、上位の回答に記録

、この場合、あなたはGlassFishの4.1.1を使用していないために必要なすべての、ちょうど4.1のGlassFishをインストールして解決し、この問題(解決するため、 4.1.1のエラーが私から長すぎる時間を費やしました。

関連する問題