Tomcat 7 Guava issue? - jsf-2

I'm working on a JSF2, MyFaces and Guava website. Earlier i deployed it on a Glassfish v3 server with no problem. Now i get this strange error when i trying to deploy it on my tomcat 7 server:
YYYY-MMM-DD HH:mm:ss org.apache.catalina.startup.ContextConfig checkHandlesTypes
VARNING: Unable to load class [com.google.common.base.Equivalences$Impl] to check against the #HandlesTypes annotation of one or more ServletContentInitializers.
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2823)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1655)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1988)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1951)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1840)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1808)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1794)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1214)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:828)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:302)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5148)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
So far, i know something goes wrong with the Guava library on startup. Has anyone stumbled upon this issue before?

Related

Terracotta 4.3 - jar conflicts

I am trying to configure terracotta 4.3 with my application. I have done all the necessary changes but when i start my tomcat server, i get the below error(in bold). Can someone suggest how do i go about resolving it. Please note that i cannot exclude jaxrs-api.jar as it is needed for external rest calls.
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 'pendingAccountCacheManager' defined in URL
[file:/C:/dev/apache-tomcat-7.0.16_1/webapps/account/WEB-INF/classes/context/account-cacheloader.xml]:
Invocation of init method failed; nested exception is
net.sf.ehcache.CacheException: Failed to instantiate ManagementServer.
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at
org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722) Caused by:
net.sf.ehcache.CacheException: Failed to instantiate ManagementServer.
at
net.sf.ehcache.management.ManagementServerLoader.register(ManagementServerLoader.java:140)
at
net.sf.ehcache.CacheManager.initializeManagementService(CacheManager.java:553)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:516) at
net.sf.ehcache.CacheManager.init(CacheManager.java:395) at
net.sf.ehcache.CacheManager.(CacheManager.java:356) at
org.springframework.cache.ehcache.EhCacheManagerFactoryBean.afterPropertiesSet(EhCacheManagerFactoryBean.java:138)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
... 20 more Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601) at
net.sf.ehcache.management.ManagementServerLoader$ManagementServerHolder.start(ManagementServerLoader.java:215)
at
net.sf.ehcache.management.ManagementServerLoader.register(ManagementServerLoader.java:125)
... 27 more
Caused by: java.lang.LinkageError: ClassCastException: attempting to castjar:file:/C:/dev/apache-tomcat-7.0.16_1/webapps/pendingaccount/WEB-INF/lib/jaxrs-api-3.0.9.Final.jar!/javax/ws/rs/client/ClientBuilder.class
to
jar:file:/C:/dev/apache-tomcat-7.0.16_1/webapps/pendingaccount/WEB-INF/lib/ehcache-ee-2.10.0.0.26.jar!/rest-management-private-classpath/javax/ws/rs/client/ClientBuilder.class_terracotta
at
javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:97)
at
com.terracotta.management.security.impl.JerseyIdentityAssertionServiceClient.(JerseyIdentityAssertionServiceClient.java:67)
at
net.sf.ehcache.management.ManagementServerImplEE.loadEmbeddedAgentServiceLocator(ManagementServerImplEE.java:132)
at
net.sf.ehcache.management.ManagementServerImplEE.initialize(ManagementServerImplEE.java:71)
at
net.sf.ehcache.management.ManagementServerImplEE.initialize(ManagementServerImplEE.java:184)
... 33 more
To resolve this,I added the ehcache-ee-2.10.0.0.26.jar and other terracotta related jars into the endorsed folder of tomcat. This helped resolve the issue of conflicting jars.

Error when deploying Primefaces app to tomcat

we have a problem deploying a Primefaces JSF application to a Tomcat from eclipse.
The used libs are:
tomcat 7
eclipse 4.3
mojarra 2.2
primefaces 4.0
eclipselink 2.5
After starting the server we are getting the following stacktrace:
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/faces/context/PartialViewContextFactory
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4961)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5455)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: javax/faces/context/PartialViewContextFactory
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:926)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1617)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:591)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482)
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:989)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:360)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
... 10 more
This error occured right after adding the primefaces library to the project. Does anybody know this problem with primefaces?

Flume fails on config file

I have some code I inherited and there is little documentation. The system keeps failing on various errors. It seems to me it is not reading the jar files and I am not even sure where it is looking. Here is the error below. Can anyone offer any advice?
- Creating instance of source Twitter, type uk.co.senym.flume.TweetDataSource
13 Dec 2013 15:29:55,923 ERROR [conf-file-poller-0](org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run:142) - Failed to load configuration data. Exception follows.
org.apache.flume.FlumeException: Unable to load source type: uk.co.senym.flume.TweetDataSource, class: uk.co.senym.flume.TweetDataSource
at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:67)
at org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:40)
at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:327)
at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:102)
at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:140)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: uk.co.senym.flume.TweetDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:65)
... 11 more
If you're using a recent version of Flume then you should use the plugins.d directory.
I'll assume for the moment you are using a Bigtop-derived distribution such as Cloudera CDH4. Then you want to take a look # /etc/flume-ng/conf/flume-env.sh to see if they were customizing the Flume classpath to point to the jar file for your custom twitter source.
That is the old way and it kinda sucks. A better way is to put your stuff into plugins.d as documented here: http://archive.cloudera.com/cdh4/cdh/4/flume-ng/FlumeUserGuide.html#installing-third-party-plugins
I believe the default plugins.d directory on CDH4 is /var/lib/flume-ng/plugins.d
HTH

Struts2 Update to 2.3.15.1 implies Tiles upgrade to 3.0.1?

Due to the security issues in Struts 2.3.14.3 we upgraded to Struts 2.3.15.1 today.
But we have a problem, since the struts2-tiles-plugin was updated from version 2.1.4 to 3.0.1 and our server is not working anymore.
The error is:
18.07.2013 16:19:20 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/tiles/web/startup/TilesListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at de.hybris.tomcat.HybrisWebappClassLoader60.findClassInternal(HybrisWebappClassLoader60.java:2244)
at de.hybris.tomcat.HybrisWebappClassLoader60.findClass(HybrisWebappClassLoader60.java:982)
at de.hybris.tomcat.HybrisWebappClassLoader60.loadClass(HybrisWebappClassLoader60.java:1610)
at de.hybris.tomcat.HybrisWebappClassLoader60.loadClass(HybrisWebappClassLoader60.java:1443)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4078)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
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.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:244)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.apache.tiles.web.startup.TilesListener
at de.hybris.tomcat.HybrisWebappClassLoader60.loadClass(HybrisWebappClassLoader60.java:1663)
at de.hybris.tomcat.HybrisWebappClassLoader60.loadClass(HybrisWebappClassLoader60.java:1443)
... 29 more
18.07.2013 16:19:20 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Skipped installing application listeners due to previous error(s)
18.07.2013 16:19:20 org.apache.catalina.core.StandardContext start
Now I am a bit stuck, since this article here: How to integrate Struts 2 with Tiles 3 starts to integrate tiles-extras (why do I need that, exactly) and uses annotations and listeners and whatever. I just wanted to do a quick update of struts and not do an update of tiles as well. Can anyone point me out exactly how to do that?
Thanks for any help :)
We upgraded now only the struts packages and tiles (including the problematic tiles-servlet) to version 2.2.2.
The implementation of tiles 3.0.1 in the new struts package is incomplete and cannot be used.

Grails test war when deployed in tomcat gives ERROR

Even after increasing heap size I get Perm Gen and also the following error.
I get first the following and after repeated attempts to access my application I get Perm Gen
JDK: 1.6
Grails : 2.0.0
Tomcat 7
I have no clue how to resolve.
SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.VerifyError: (class: org/codehaus/groovy/runtime/InvokerInvocationException, method: getMessage signature: ()Ljava/lang/String;) Illegal constant pool index
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:118)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.VerifyError: (class: org/codehaus/groovy/runtime/InvokerInvocationException, method: getMessage signature: ()Ljava/lang/String;) Illegal constant pool index
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:97)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:884)
at groovy.lang.Closure.call(Closure.java:410)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.doWithApplicationContext(DefaultGrailsPlugin.java:489)
at org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.doPostProcessing(AbstractGrailsPluginManager.java:169)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.performPostProcessing(GrailsRuntimeConfigurator.java:232)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:172)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:124)
at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:121)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:104)
... 9 more
You're getting a VerifyError which means you problem is most likely a classpath problem, or you compiled using a different Java version to what you are running under.

Resources