Page 1 of 1

Tomcat 6 Problems on Ubuntu 9.10

PostPosted: Mon Nov 02, 2009 9:18 pm
by jeremyh
We decided to update the server from Ubuntu 9.04 to 9.10. After reboot, something was screwed up with Tomcat5.5, so we installed Tomcat6 and attempt to deploy the subsonic war. This fails (it expands the directory but fails to make any subsonic logs) and we receive the following error in the tomcat log:

Nov 2, 2009 2:10:21 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Nov 2, 2009 2:10:24 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'playerDao' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Cannot resolve reference to bean 'daoHelper' while setting bean property 'daoHelper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoHelper' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [net.sourceforge.subsonic.dao.DaoHelper]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoHelper' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [net.sourceforge.subsonic.dao.DaoHelper]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 49 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [net.sourceforge.subsonic.dao.DaoHelper]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 60 more
Caused by: java.lang.ExceptionInInitializerError
at net.sourceforge.subsonic.dao.DaoHelper.createDataSource(DaoHelper.java:72)
at net.sourceforge.subsonic.dao.DaoHelper.<init>(DaoHelper.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 62 more
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission subsonic.defaultPlaylistFolder read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
at java.lang.System.getProperty(System.java:686)
at net.sourceforge.subsonic.util.Util.getDefaultPlaylistFolder(Util.java:49)
at net.sourceforge.subsonic.service.SettingsService.<clinit>(SettingsService.java:106)
... 69 more
Nov 2, 2009 2:10:24 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext


The only reference I could find similar to this in the forum involved using some other JVM that sun, but we are using only the Sun JVM (1.6.0_16).

Does anyone have any suggestions?

Partially resolved

PostPosted: Tue Nov 03, 2009 12:22 am
by jeremyh
Ok, we got it going a little better by doing two things:
1) Turned off the tomcat security in /etc/init.d/tomcat6. To fix issue as reported here: https://bugs.launchpad.net/ubuntu/+sour ... bug/374567)
2) Because we moved from tomcat5.5 to tomcat6, the owner on /var/subsonic folders and files were still specified as tomcat5.5. We recursively chowned that folder to switch the ownership.

Also, we upped the memory for tomcat in the /etc/init.d/tomcat6 script from 128M to 1024M.

Currently, there are two problems. An index rebuild is really slow now, and the left frame with the music list doesn't seem to be loading. (and the entire application is now _SLOW_).

Back working

PostPosted: Tue Nov 03, 2009 7:36 pm
by jeremyh
Ok, everything is back working. :)

The slow index build was only for the initial build (for some reason the previous index wasn't working, so we moved it and rebuilt). That fixed the index.

The left pane started working once users forcible logged off and back on - (a browser refresh, both forced and normal, did not fix the left pane).

Memory use is 265.0 MB/ 503.4 MB, so we could probably get by with 768 or maybe 512 without issues.
Overall we are running subsonic 3.8 (build 1130), on Apache Tomcat/6.0.20, java 1.6.0_16, under Ubuntu 9.10.

PostPosted: Thu Nov 05, 2009 9:05 am
by predator7
hi, i use subsonic 3,8 on tomcat 6.0.2 on ubuntu 9.10 too. i tried to start sobsonic under the tomcat manager, it won't start until i turned the Security Manager of tomcat off. did you expirienced the same problem?

and another question how do you increase the memory for tomact/subsonic?

Tomcat 6

PostPosted: Thu Nov 05, 2009 3:53 pm
by jeremyh
Yes, I had to turn off the Security Manager in Tomcat 6 also. From the article I linked above, it may or may not be a problem for your situation. For us, it is not a big deal, but it would be nice to not have to turn it off. It sounds like you could set up a policy file for tomcat to allow for certain access to the machine from the subsonic deployable and then turn the security back on, but I didn't have the time to figure it out.

The memory for tomcat is allocated as a JVM_OPTS switch at startup. There is a line in the /etc/init.d/tomcat6 script that sets the maximum java heap size:

JAVA_OPTS="-Djava.awt.headless=true -Xmx256M"

You just bump up the -Xmx value (Maximum java heap size)
You could also specify the initial java heap size with "-Xms" if you didn't want the java instance to have to resize the heap while running.

There is an additional warning on the description of these which says:
"If you monitor your java process with an OS tool like top or taskmanager, you may see the amount of memory you use exceed the amount you have specified for -Xmx. -Xmx limits the java heap size, java will allocate memory for other things, including a stack for each thread. It is not unusual for the total memory consumption of the VM to exceed the value of -Xmx."

ubuntu 9.10 display problem

PostPosted: Fri Dec 18, 2009 5:50 pm
by gottymann

PostPosted: Thu Dec 24, 2009 4:22 pm
by TuckLive
Turning off the security manager worked for me running 10.04. I'm not an expert at Tomcat, but I would rather not turn off security all together. Maybe a discussion is needed about how to set the right amount of security? I would like to see Sindre voice his opinion on the security needed.