2016-07-08 62 views
1

我使用NetBeans(IDE)和GlassFish 4.1.0(Web服務器)開發了JavaEE 7.0 Web應用程序。紅帽服務器中的java.lang.IllegalArgumentException

當我將它部署在本地主機上時,該應用程序像一個魅力一樣工作。現在,我想使用GlassFish 4.1.0將其部署到紅帽企業版Linux服務器5.11上。

因此,我在我的Red Hat服務器上安裝GlassFish和我按照這些步驟:

  1. 開業GlassFish的管理控制檯,併到「應用程序」節點: enter image description here
  2. 點擊了「部署」按鈕並選擇我想要部署的應用程序的戰爭文件(存儲在紅帽服務器中): enter image description here
  3. 單擊「選擇文件」。出現以下窗口: enter image description here
  4. 我的應用程序需要一些JAR文件才能正常工作。所有這些都保存在以下文件夾: enter image description here
  5. 然後我插入了GlassFish管理控制檯的「庫」條目中的所有路徑: enter image description here
  6. 部署的應用程序,並重新啓動了NetBeans服務器

然而,每個我跑我的web應用程序時,我得到以下錯誤:

[2016-07-08T21:20:15.226+0200] [glassfish 4.1] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1468005611695] [timeMillis: 1468005615226] [levelValue: 1000] [[ 

    Exception during lifecycle processing 

java.lang.IllegalArgumentException: Specified library jar android-7.jar does not exist: /opt/glassfish4/glassfish/domains/domain1/lib/android-7.jar 

    at org.glassfish.deployment.common.DeploymentContextImpl.getAppLibs(DeploymentContextImpl.java:458) 

    at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:244) 

    at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:229) 

    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:365) 

    at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406) 

    at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:243) 

    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329) 

    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377) 

    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461) 

    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:227) 

    at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:84) 

    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258) 

    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105) 

    at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87) 

    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162) 

    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147) 

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 

    at java.lang.Thread.run(Thread.java:745) 

]] 

我真不明白是怎麼回事,難道你能幫我嗎?

回答

2

Then I inserted all the paths in the "Libraries" entry of the GlassFish Administration Console:

你不需要這樣做,我想這是造成這個問題。

GlassFish是自動搜索在lib文件夾庫,如果不工作,你也可以嘗試在/opt/glassfish4/glassfish/lib

服務器全球lib文件夾如果它仍然無法與訪問工作有可能是問題權利,但在你的屏幕截圖上看起來很好(世界可讀)。

+0

嗨unwichtich,其實它像一個魅力。非常感謝您的幫助。我很感激。 –