participate


Sun Java System Web Server - Phobos Deploy problem
<<   Back to Forum  |   Give us Feedback
This topic has 11 replies on 1 page.
TonyZ
Posts:62
Registered: 2/23/06
Phobos Deploy problem   
Mar 21, 2008 3:05 PM

 
Hi, I am trying to deploy a Phobos app to a virtual server and I am getting the following error in my logs.

The deploy says it is successful, but the app does not respond to requests. Can anyone tell me how to resolve this?

Thanks,
Tony

om.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.)) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.catalina.startup.DigesterLogger.<init>(ContextConfig.java:1038) at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:339) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:784) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:263) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:130) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5021) at com.sun.webserver.connector.nsapi.WebModule.start(WebModule.java:182) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224) at org.apache.catalina.core.StandardHost.start(StandardHost.java:924) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520) at org.apache.catalina.startup.Embedded.start(Embedded.java:917) at com.sun.enterprise.web.PwcWebContainer.onStartup(PwcWebContainer.java:70) at com.sun.webserver.connector.nsapi.WebContainer.start(WebContainer.java:478) at com.sun.webserver.init.J2EERunner.confPostInit(J2EERunner.java:304) Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 17 more Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385) ... 18 more
 
  sriram.natarajan
Posts:365
Registered: 11/13/07
Re: Phobos Deploy problem   
Mar 21, 2008 4:08 PM (reply 1 of 11)  (In reply to original post )

 
which version of web server are you using here ?

if you are not trying it out with web server 7 update 2, can u try it out and let us know
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=SJWS-7.0U2-OTH-G-F@CDS-CDS_SMI
 
TonyZ
Posts:62
Registered: 2/23/06
Re: Phobos Deploy problem   
Mar 21, 2008 6:21 PM (reply 2 of 11)  (In reply to #1 )

 
I am sorry for not being more clear. I am using version 7 update 2. I just installed it about two weeks ago.

I am running it on Debian Linux.
I do have four virtual hosts in one configuration set up on four different ip addresses.
Two of the virtual hosts have Java applications installed and running fine.
The third virtual host is just serving static content.
The fourth virtual host I am trying to install the Phobos app on.

The other Java apps have many jar files as they are forum software ecommerce software.

I am new to the Sun Web Server so this is my first time setting up a production server. Should each virtual host be in its own configuration? or does that not make any difference in this situation?

Thanks,

Tony
 
  Arvind_Srinivasan
Posts:127
Registered: 7/21/06
Re: Phobos Deploy problem   
Mar 24, 2008 5:20 AM (reply 3 of 11)  (In reply to #2 )

 
Check the .jars in your Java class-path and/or in the Phobos app. The error message from your stack trace indicates that there are 2 .jar files with different versions of the same class - com.sun.org.apache.commons.logging.Log
Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.) at
 
TonyZ
Posts:62
Registered: 2/23/06
Re: Phobos Deploy problem   
Mar 24, 2008 12:28 PM (reply 4 of 11)  (In reply to #3 )

 
Any idea on how to find the double class inside all of the jar files? When I try to deploy a bare bones Phobos app, this is what shows up in the log. If you look at the beginning, there are a few errors before the stack trace. I know this class comes in jsf-impl.jar, but there is only one of those in my class path.

Here is my class path as well from my server.xml.

<jvm>
<java-home>/usr/lib/jvm/java-6-sun-1.6.0.04</java-home>
<class-path-prefix/>
<server-class-path>/sun/webserver7/lib/webserv-rt.jar:/sun/webserver7/lib/pwc.jar:/sun/webserver7/lib/ant.jar:${java.home}/lib/tools.jar:/sun/webserver7/lib/ktsearch.jar:/sun/webserver7/lib/webserv-jstl.jar:/sun/webserver7/lib/jsf-impl.jar:/sun/webserver7/lib/jsf-api.jar:/sun/webserver7/lib/webserv-jwsdp.jar:/sun/webserver7/lib/container-auth.jar:/sun/webserver7/lib/mail.jar:/sun/webserver7/lib/activation.jar</server-class-path>
<class-path-suffix/>
<native-library-path-prefix/>
<debug>false</debug>
<debug-jvm-options>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7896</debug-jvm-options>
<jvm-options>-Djava.security.auth.login.config=login.conf</jvm-options>
<jvm-options>-Xms512m -Xmx768m</jvm-options>
<jvm-options>-XX:MaxPermSize=256m</jvm-options>
</jvm>

24/Mar/2008:14:16:19 failure Click to view more details for this message PWC3014: Parse error in application web.xml
com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.)) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at
com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.catalina.startup.DigesterLogger.<init>(ContextConfig.java:1038) at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:339) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:784) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:263) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:130) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5021) at com.sun.webserver.connector.nsapi.WebModule.start(WebModule.java:182) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224) at org.apache.catalina.core.StandardHost.start(StandardHost.java:924) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520) at org.apache.catalina.startup.Embedded.start(Embedded.java:917) at com.sun.enterprise.web.PwcWebContainer.onStartup(PwcWebContainer.java:70) at com.sun.webserver.connector.nsapi.WebContainer.start(WebContainer.java:478) at com.sun.webserver.init.J2EERunner.confPostInit(J2EERunner.java:304) Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. (Caused by com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed.) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397) at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 17 more Caused by: com.sun.org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'com.sun.org.apache.commons.logging.Log' visible, which is not allowed. at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385) ... 18 more
24/Mar/2008:14:16:19 failure PWC3040: Marking this application unavailable due to previous error(s)
24/Mar/2008:14:16:19 failure PWC1306: Startup of context failed due to previous errors
24/Mar/2008:14:16:19 failure Null component com.sun.web-2:type=JspMonitor,name=jsp,WebModule=//planetphobos/,J2EEApplication=null,J2EEServer=none
24/Mar/2008:14:16:19 info CORE3280: A new configuration was successfully installed
24/Mar/2008:14:16:18 info CORE3276: Installing a new configuration
24/Mar/2008:14:16:18 info WEB0100: Loading web module in virtual server [planetphobos] at [/]
 
  Arvind_Srinivasan
Posts:127
Registered: 7/21/06
Re: Phobos Deploy problem   
Mar 25, 2008 5:55 AM (reply 5 of 11)  (In reply to #4 )

 
Your server-class-path entries look ok. Check inside each of the .jar files in the phobos web application's WEB-INF/lib directory.

Edited by: Arvind_Srinivasan on Mar 25, 2008 5:54 AM
 
TonyZ
Posts:62
Registered: 2/23/06
Re: Phobos Deploy problem   
Mar 25, 2008 8:04 AM (reply 6 of 11)  (In reply to #5 )

 
I found it in a jar file inside the Phobos lib directory. So what are my options for fixing this? I also emailed the Phobos mailing list on this.

Thanks,

Tony Z
 
  Arvind_Srinivasan
Posts:127
Registered: 7/21/06
Re: Phobos Deploy problem   
Mar 26, 2008 12:59 AM (reply 7 of 11)  (In reply to #6 )

 
Please could you point me to the Phobos sample that is giving you this problem. I was able to successfully deploy both example.war and demoj1.war from https://phobos.dev.java.net/getting_started.html. If I can reproduce your problem then I'll be able to tell you which file you need to remove/change to fix the startup issue.
 
TonyZ
Posts:62
Registered: 2/23/06
Re: Phobos Deploy problem   
Mar 26, 2008 7:31 AM (reply 8 of 11)  (In reply to #7 )

 
Thank you for responding. I downloaded and can deploy each of the examples you referenced as well, and they work fine. However, I am using Netbeans 6. If I do a sample new application, build it, and deploy it, I get the error messages I previously posted. Those war files may be somewhat dated on the Phobos site. I will post this info to the Phobos mailing list as well. Is there anyway to manually adjust these? What if you had two applications that needed two different versions of a library?

Thanks,

Tony Z
 
  Arvind_Srinivasan
Posts:127
Registered: 7/21/06
Re: Phobos Deploy problem   
Mar 27, 2008 4:22 AM (reply 9 of 11)  (In reply to #8 )

 
Thanks. I was able to reproduce the problem.

I was able to work-around/fix the problem in 2 ways

1. Removing/renaming WEB-INF/lib/logging-api-1.0.4.jar from the Phobos sample application
2. Creating/adding WEB-INF/sun-web.xml and setting the class-loader delegate attribute to true.
% cat /tmp/phob/WEB-INF/sun-web.xml
<?xml version="1.0" encoding="UTF-8" ?>
 
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN' 'http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-0.dtd'>
 
 
<sun-web-app>
    <class-loader delegate='true'/>
</sun-web-app>


#2 is the preferred solution, although I doubt #1 will do any serious harm.
Two applications requiring different versions of a library wouldn't be a problem as each web application could keep that library in its WEB-INF/lib directory. The problem (like in this case) occurs when a web application uses a different version of the library that is also in the server classpath or is also used by the servlet/jsp implementation in the server.

Ideally, the implementation classes of the servlet/jsp container wouldn't be visible to web applications and then you wouldn't run into this kind of problem. We'd planned to do this but haven't yet done so.

http://docs.sun.com/app/docs/doc/819-2634/gdqup?a=view documents the classloader hierarchy in Web Server. By setting the class-loader delegate flag, you can configure the preferred order in which classloaders are used for loading a particular class.
 
TonyZ
Posts:62
Registered: 2/23/06
Re: Phobos Deploy problem   
Mar 27, 2008 8:09 AM (reply 10 of 11)  (In reply to #9 )

 
Thank you for helping me through this. I would never have traced this down without your help. I tried solution two and it worked like a charm. I have also updated the Phobos mailing list. I will now know how to recognize this in the future if needed. We will be able to move on to more programming! :-)
 
  Arvind_Srinivasan
Posts:127
Registered: 7/21/06
Re: Phobos Deploy problem   
Mar 28, 2008 1:32 AM (reply 11 of 11)  (In reply to #10 )

 
Happy to help. Thanks for choosing to use Web Server 7.
 
This topic has 11 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 54
  • Guests : 123

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums