Application not deploying on Tomcat server - java

I am trying to run an application on tomcat server. The application was earlier running on Jboss EAP. All the configuration changes have been made in the tomcat context.xml and other application related configuration files like web.xml, etc. The only ERROR and SEVERE logs that I see when the application is being deployed are mentioned below:
[main] ERROR org.springframework.web.context.ContextLoader - Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'redisCacheManager' defined in class path
resource [config/serviceContext.xml]: Instantiation of bean failed;
nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [com.tcs.cdm.cache.CacheManager]: Constructor threw
exception; nested exception is java.lang.Error: Unresolved compilation
problems: The type redis.clients.jedis.JedisPoolConfig cannot be
resolved. It is indirectly referenced from required .class files
. . .
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 'redisCacheManager' defined in class path
resource [config/serviceContext.xml]: Instantiation of bean failed;
nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [com.tcs.cdm.cache.CacheManager]: Constructor threw
exception; nested exception is java.lang.Error: Unresolved compilation
problems: The type redis.clients.jedis.JedisPoolConfig cannot be
resolved. It is indirectly referenced from required .class files
. . .
SEVERE: One or more listeners failed to start. Full details will be
found in the appropriate container log file
org.apache.catalina.core.StandardContext startInternal SEVERE: Context
[/AppName] startup failed due to previous errors
I have gone through several threads but did not find any solution working for me. I have tried making version changes to jsf related jars in my pom.xml but that also doesn't help. I am currently using tomcat version 9.0.36 but have also tried TomEE 8.0.8 for the same but facing the same issue in both the cases. It would be great if someone could guide as to why this error is coming or a possible solution for the same.

Related

Websphere with Oracle DB deployment Error NosuchMethod

I am trying to deploy war file on websphere 8.5.5.13. which is connected to oracle(11g) db and even i had created data sources connection on websphere.
The application is getting installed but when i try to start the application gives me the following error:
[29/10/18 15:00:49:733 IST] 000001e1 SystemErr R Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index; (loaded from file:/C:/Program Files (x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#180c62e2) called from class org.hibernate.cfg.annotations.EntityBinder (loaded from file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/DefaultAppServer/installedApps/AntivirusServerNode01Cell/cream_war.ear/cream.war/WEB-INF/lib/hibernate-core-5.0.12.Final.jar by
[29/10/18 15:00:49:733 IST] 000001e1 SystemErr R Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/Table.indexes()[Ljavax/persistence/Index; (loaded from file:/C:/Program Files (x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader#180c62e2) called from class org.hibernate.cfg.annotations.EntityBinder (loaded from file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/DefaultAppServer/installedApps/AntivirusServerNode01Cell/cream_war.ear/cream.war/WEB-INF/lib/hibernate-core-5.0.12.Final.jar by
I also tried changing the version of hibernate and jpa but that too didnt work.
But when i deploy application without using oracle db (using h2 or derby) it runs properly.
Please help me out with this error.
Not able to find the path
The NoSuchMethodError indicates that Hibernate is trying to call a method on javax.persistence.Table that doesn't exist. The Table class has been loaded from file:/C:/Program Files (x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar so it's WAS itself that's providing the incompatible class.
By default, WAS 8.5.5 uses JPA 2.0 but it is possible to use JPA 2.1 by following the steps described here. You've already done most of the steps described in "Embedding a third-party persistence provider within an application". The one remaining step is to configure your application's class loader order so that it will prefer classes bundled with your application to those provided by the application server.

Solace - Failed to create InitialContext when the solace jar was upgraded to v10.1

We have upgraded the solace version from 7.1 to 10.1 for an existing spring based application. After upgrading it, we started the application and observed the below error. Is new solace jar causing this error?
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solaceConnectionFactory' defined in class path resource [SolRes.xml]: Invocation of init method failed; nested exception is javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable [Root exception is java.lang.NullPointerException]

com.atomikos.icatch.SysException: Error in init: Log already in use? tmlog in ./

I have a very big problem with my atomikos. I cant create bean because of below error:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authenticatingSignInAdapter': Unsatisfied dependency expressed through field 'userRepoAutowired': Error creating bean with name 'userRepo': Invocation of init method failed; nested exception is com.atomikos.icatch.SysException: Error in init: Log already in use? tmlog in ./; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepo': Invocation of init method failed; nested exception is com.atomikos.icatch.SysException: Error in init: Log already in use? tmlog in ./
I read a link: solve error : log already in use with atomikos with multiple instances. but nothing helped me. Do you know what can be a problem? It is only one bean that cant be created.
It looks like you are starting multiple instances on the same log folder / log file.

Jetty8 and Java Bean tmp failed

<code>[ERROR] 2016-01-23 14:48:41,925 [main] org.springframework.web.context.ContextLoader {} - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ConsumerEndpointFactoryBean#54': Cannot resolve reference to bean 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#10' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#10': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanInitializationException: failed to initialize MessageHandler; nested exception is java.lang.IllegalArgumentException: Destination directory [./taust-ee] could not be created</code>
I have this strange problem when running Jetty 8 on Debian 8 Jessie... Don't know where to dig, apps seems to be okay, because on windows and deployed by Jenkins running well. Where can be problem?

javaagent error in tomcat

Error:
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
'org.springframework.context.weaving.AspectJWeavingEnabler#0':
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'loadTimeWeaver': Initialization of bean failed; nested
\exception is java.lang.IllegalStateException: ClassLoader
[org.apache.catalina.loader.WebappClassLoader] does NOT provide an
'addTransformer(ClassFileTransformer)' method. Specify a custom
LoadTimeWeaver or start your Java virtual machine with Spring's agent:
-javaagent:spring-agent.jar
But I have javaagent in my tomcat VM arguments
-Dext.prop.dir="/home/gopi/Desktop/REST_CONFIG" -javaagent:/home/gopi/.m2
/repository/org/springframework/spring-agent/2.5.6/spring-agent-
2.5.6.jar -Dcatalina.base="/opt/apache-tomcat-7.0.62"
-Dcatalina.home="/opt/apache-tomcat-7.0.62" -Dwtp.deploy="/opt/apache-
tomcat-7.0.62/wtpwebapps" -Djava.endorsed.dirs="/opt/apache-tomcat-
7.0.62/endorsed"
-Dext.prop.dir and -javaagent added by me and remaining are by default.. How do i solve this issue? Any ideas?
I guess you need to give below to specify which loadTimeWeaver to use. See here for details.
<context:load-time-weaver
weaver-class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"/>
</beans>

Categories