我有一个Glassfish 3.1.2群集。
我有2个ssh节点,每个节点有1个实例。
我在DAS domains/mydomain/config/mycluster-config/lib/
目录中添加了我的lib jar。
当我重新启动我的实例时,我看到jar被复制到以下各个节点:
nodes/node1/instance1/config/mycluster-config/lib/
目录和
nodes/node2/instance2/config/mycluster-config/lib/
目录。
我的应用程序是一个带有Richfaces 4.3的JSF 2.2应用程序
问题在于,当我部署应用程序时,应用程序无法从我的libs中找到任何jar文件。
一个问题是:如何设置节点的类路径?
我试过了:
export LD_LIBRARY_PATH="/path/to/node1/instance1/config/prodc-config/lib"
和另一个节点上的命令相同。
这不能使我的应用程序找到库。
如果我将我的EAR部署到独立域而不是群集,那么它将部署而没有任何错误。
当我从Web管理控制台部署我的应用程序时,我检查了可用性,并确保目标指向mycluster。
这些是我得到的一些错误:
WELD-000119 Not generating any bean definitions from com.my.domain.Validate because of underlying class loading error
Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory. Attempting to find backup.
群集始终能够启动。 实例开始和停止都很好。
部署我的EAR时的完整信息是:
Warning Command succeeded with Warning
"domain/applications/application/my_EAR" created successfully.
WARNING: Command _deploy did not complete successfully on server instance instance1: remote failure:
Failed to load the application on instance instance1.
The application will not run properly. Please fix your application and redeploy.
Exception while shutting down application container : java.lang.NullPointerException. Please see server.log for more details.
WARNING: Command _deploy did not complete successfully on server instance instance2: remote failure:
Failed to load the application on instance instance2. The application will not run properly. Please fix your application and redeploy.
Exception while shutting down application container : java.lang.NullPointerException. Please see server.log for more details.
WARNING: Command _deploy did not complete successfully on server instance instance1: remote failure:
Failed to load the application on instance instance1. The .... msg.seeServerLog
感谢您对我的问题提供任何帮助。
答案 0 :(得分:1)
对于GlassFish v3.1.2,我一直在使用此链接:http://docs.oracle.com/cd/E18930_01/html/821-2426/gkrdd.html#gksav
部署应用程序时,我必须在部署期间指定库。这些库与applibs目录相关。因此,对于群集,路径将是:
../../config/clustername-config/lib/util.jar
我的问题一定是在指定此目录时我没有得到正确的路径。这就是我没有仔细观察我正在使用的路径。
所以,简短回答:在将应用部署到群集时使用--libraries
并确保路径正确。