我们有一个Java EE应用程序,我们使用JSF和Omnifaces(v 2.6.3)和Primefaces(v 6.1),部署在GlassFish v 4.1.2上。
虽然应用程序运行正常(我可以浏览页面并使用它们)但是我们在日志中有一些关于某些类的警告,这些类在omnifaces和primefaces中都找不到。是的,关于" ClassNotFound异常的警告",因此它本身不是例外,只是警告它,在警告之后,服务器继续正常运行并成功部署我的应用程序。
Eclipse和手动asadmin
都会发生这种情况。
应用程序的结构是这样的(我有一个EJB应用程序,一个Web服务应用程序和触发警告的JSF):
EAR
├───WebService_war
│ ├───META-INF
│ │ MANIFEST.MF
│ │
│ └───WEB-INF
│ │ web.xml
│ │
│ ├───classes
│ │ ...
│ └───config
│ ...
│
├───lib
│ │ common.jar
│ │ ...
│
├───META-INF
│ application.xml
│ glassfish-resources.xml
│
├───EJBapp_jar
│ └───META-INF
│ │ glassfish-ejb-jar.xml
│ │ MANIFEST.MF
│ │
│ └───config
│ ...
│
└───JSFapp_war
│ index.xhtml
│ ...
│
├───META-INF
│ MANIFEST.MF
│
├───resources
│ ├───css
│ │ custom.css
│ │
│ ├───imgs
│ │ logo.png
│ │
│ └───js
│ foo.js
│
└───WEB-INF
│ beans.xml
│ faces-config.xml
│ hestaglib.xml
│ shiro.ini
│ web.xml
│
├───classes
│ ...
├───common
│ footer.xhtml
│ header.xhtml
│ template.xhtml
│
├───config
│ ...
│
└───lib
omnifaces-2.6.3-javadoc.jar
omnifaces-2.6.3.jar
primefaces-6.1-sources.jar
primefaces-6.1.jar
如果我在EAR的lib
目录中移动primefaces库,那么与primefaces相关的警告就会消失。
尽管这不是一个合适的解决方案,但主要是"本地"对于JSF应用程序,以及omnifaces(如果我尝试移动omnifaces库,我得到一些initializatoin错误,应用程序中断)。
这种行为的原因是什么?我怎样才能摆脱警告? 可能有潜在的错误吗?
警告(还有更多,这只是其中的一小部分):
2017-11-24T08:18:22.264+0200|Warning: Unable to load class org.primefaces.component.tieredmenu.TieredMenuRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.tieredmenu.TieredMenuRenderer
2017-11-24T08:18:22.270+0200|Warning: Unable to load class org.primefaces.mobile.renderkit.BaseMenuRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.mobile.renderkit.BaseMenuRenderer
2017-11-24T08:18:22.280+0200|Warning: Unable to load class org.primefaces.component.contextmenu.ContextMenuRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.contextmenu.ContextMenuRenderer
2017-11-24T08:18:22.284+0200|Warning: Unable to load class org.primefaces.component.menubar.MenubarRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.menubar.MenubarRenderer
2017-11-24T08:18:22.287+0200|Warning: Unable to load class org.primefaces.component.slidemenu.SlideMenuRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.slidemenu.SlideMenuRenderer
2017-11-24T08:18:22.293+0200|Warning: Unable to load class org.primefaces.mobile.renderkit.MenuRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.mobile.renderkit.MenuRenderer
2017-11-24T08:18:22.297+0200|Warning: Unable to load class org.primefaces.mobile.renderkit.TabMenuRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.mobile.renderkit.TabMenuRenderer
2017-11-24T08:18:22.301+0200|Warning: Unable to load class org.primefaces.component.growl.GrowlRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.growl.GrowlRenderer
2017-11-24T08:18:22.304+0200|Warning: Unable to load class org.primefaces.component.message.MessageRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.message.MessageRenderer
2017-11-24T08:18:22.306+0200|Warning: Unable to load class org.primefaces.component.messages.MessagesRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.component.messages.MessagesRenderer
2017-11-24T08:18:22.313+0200|Warning: Unable to load class org.primefaces.mobile.renderkit.GrowlRenderer, reason: java.lang.ClassNotFoundException: org.primefaces.mobile.renderkit.GrowlRenderer
2017-11-24T08:18:22.315+0200|Warning: Unable to load class org.omnifaces.component.tree.TreeInsertChildren, reason: java.lang.ClassNotFoundException: org.omnifaces.component.tree.TreeInsertChildren
2017-11-24T08:18:22.318+0200|Warning: Unable to load class org.omnifaces.component.validator.ValidateEqual, reason: java.lang.ClassNotFoundException: org.omnifaces.component.validator.ValidateEqual
2017-11-24T08:18:22.320+0200|Warning: Unable to load class org.omnifaces.component.validator.ValidateAll, reason: java.lang.ClassNotFoundException: org.omnifaces.component.validator.ValidateAll
2017-11-24T08:18:22.322+0200|Warning: Unable to load class org.omnifaces.component.output.ResourceInclude, reason: java.lang.ClassNotFoundException: org.omnifaces.component.output.ResourceInclude
2017-11-24T08:18:22.335+0200|Warning: Unable to load class org.omnifaces.component.validator.ValidateOne, reason: java.lang.ClassNotFoundException: org.omnifaces.component.validator.ValidateOne
2017-11-24T08:18:22.338+0200|Warning: Unable to load class org.omnifaces.component.validator.ValidateMultiple, reason: java.lang.ClassNotFoundException: org.omnifaces.component.validator.ValidateMultiple
2017-11-24T08:18:22.368+0200|Warning: Unable to load class org.omnifaces.component.validator.ValidateAllOrNone, reason: java.lang.ClassNotFoundException: org.omnifaces.component.validator.ValidateAllOrNone
2017-11-24T08:18:22.370+0200|Warning: Unable to load class org.omnifaces.component.messages.OmniMessages, reason: java.lang.ClassNotFoundException: org.omnifaces.component.messages.OmniMessages
2017-11-24T08:18:22.372+0200|Warning: Unable to load class org.omnifaces.component.output.GraphicImage, reason: java.lang.ClassNotFoundException: org.omnifaces.component.output.GraphicImage
2017-11-24T08:18:22.377+0200|Warning: Unable to load class org.omnifaces.component.output.ConditionalComment, reason: java.lang.ClassNotFoundException: org.omnifaces.component.output.ConditionalComment
LE:
我忘了提到上面的设置也会在使用asadmin
:
[glassfish 4.1] [WARNING] [NCLS-DEPLOYMENT-00023] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=47 _ThreadName=admin-listener(2)] [timeMillis: 1511441893194] [levelValue: 900] [[
Ignoring JSFapp_war/ because the containing archive C:\glassfish4\glassfish\domains\domain1\applications\EAR recorded it as a pre-existing stale file]]
过时的文件正是JSF的WAR中的lib。 如果我在EAR中移动primefaces,那么只有omnifaces在重新部署时仍然是陈旧的。 这有什么用呢?