简体   繁体   English

Red Hat服务器中的java.lang.IllegalArgumentException

[英]java.lang.IllegalArgumentException in Red Hat server

I developed a JavaEE 7.0 Web Application using NetBeans (IDE) and GlassFish 4.1.0 (web server). 我使用NetBeans(IDE)和GlassFish 4.1.0(Web服务器)开发了JavaEE 7.0 Web应用程序。

The application is working like a charm when I deploy it on the localhost. 当我在本地主机上部署该应用程序时,它就像是一种魅力。 Now, I would like to deploy it on a Red Hat Enterprise Edition Linux Server 5.11 using GlassFish 4.1.0. 现在,我想使用GlassFish 4.1.0将其部署在Red Hat Enterprise Edition Linux Server 5.11上。

Therefore, I installed GlassFish on my Red Hat server and I followed these steps: 因此,我在Red Hat服务器上安装了GlassFish,并按照以下步骤操作:

  1. Opened GlassFish administration console and went to the "Applications" node: 打开GlassFish管理控制台,然后转到“应用程序”节点: 在此处输入图片说明
  2. Clicked on the "Deploy" button and selected the war file (stored in the Red Hat server) of the application I wanted to deploy: 单击“部署”按钮,然后选择要部署的应用程序的war文件(存储在Red Hat服务器中): 在此处输入图片说明
  3. Clicked on "Choose File". 点击“选择文件”。 The following window appeared: 出现以下窗口: 在此处输入图片说明
  4. My application needs some JAR files in order to work properly. 我的应用程序需要一些JAR文件才能正常工作。 All of them are saved in the following folder: 所有这些都保存在以下文件夹中: 在此处输入图片说明
  5. Then I inserted all the paths in the "Libraries" entry of the GlassFish Administration Console: 然后,将所有路径插入GlassFish管理控制台的“库”条目中: 在此处输入图片说明
  6. Deployed the application and restarted the NetBeans Server 部署应用程序并重新启动NetBeans服务器

However, each time I run my web application I get the following error: 但是,每次我运行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)

]]

I really do not understand what is going on, Could you help me please ? 我真的不明白发生了什么,请您能帮我吗?

Then I inserted all the paths in the "Libraries" entry of the GlassFish Administration Console: 然后,将所有路径插入GlassFish管理控制台的“库”条目中:

You don't need to do this, I guess this is causing the problem. 您不需要这样做,我想这是造成问题的原因。

Glassfish is searching for libs in the lib folder automatically, if this doesn't work you can also try the server global lib folder in /opt/glassfish4/glassfish/lib Glassfish会自动在lib文件夹中搜索lib ,如果这样不起作用,您还可以尝试在/opt/glassfish4/glassfish/lib服务器的全局lib文件夹。

If it still doesn't work there maybe a problem with the access rights, but on your screenshot it looks ok (world-readable). 如果仍然无法正常使用,则可能是访问权限存在问题,但是在屏幕截图上看起来还不错(世界范围内可读)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM