2013-03-09 40 views
2

我在重新部署時遇到了一些問題。 首次部署,確定。但是它會拋出這個異常。我必須重新啓動GlassFish。爲什麼有必要?java.lang.IllegalStateException:使用Glassfish時的類不變違例

SEVERE: log4j:ERROR log4j called after unloading, see http://logging.apache.org/log4j/1.2/faq.html#unload. 
SEVERE: java.lang.IllegalStateException: Class invariant violation 
at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:199) 
at org.apache.log4j.LogManager.getLogger(LogManager.java:228) 
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64) 
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253) 
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156) 
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132) 
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645) 
at com.icesoft.faces.component.portlet.Portlet.<clinit>(Portlet.java:38) 
at sun.misc.Unsafe.ensureClassInitialized(Native Method) 
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43) 
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140) 
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:949) 
at java.lang.reflect.Field.getFieldAccessor(Field.java:930) 
at java.lang.reflect.Field.set(Field.java:680) 
at 
... 

SEVERE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'bundle://184.0:1/com/sun/faces/jsf-ri-runtime.xml': DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory. 

回答

1

好像你有另一種解析器就像在你的應用程序xerces.jar正試圖重寫的GlassFish的默認解析器,但無法重新部署過程中這樣做。

如果您有任何解析器實現JAR然後通過添加

-Djava.endorsed.dirs=/myapp/lib/xerces.jar到服務器的啓動使之成爲默認解析器。

http://www.java.net/forum/topic/glassfish/glassfish/cannot-deploy-application-includes-xerces-jar-glassfish-311

+0

謝謝。但我不知道,該怎麼做 - 我應該編輯GlassFish的某個配置文件還是可以將此指令寫入IDE的某個對話框(我使用NetBeans)。 – 2013-03-10 18:49:35

+0

看看這個,http://www.gerardsetho.net/2011/02/add-jvm-options-to-glassfish.html – 2013-03-10 19:13:27

+0

我已經這樣做了,但我得到了同樣的錯誤 - -Djava.endorsed.dirs = $ {com.sun.aas.installRoot}/modules/endorsed $ {path.separator} $ {com.sun.aas.installRoot}/lib/endorsed -Djava.endorsed.dirs =/myapp /lib/xerces.jar ... 2013-03-13 20:33:02

相關問題