xmltype weblogic 10.3.6 - java

I am trying to deploy a Grails application in weblogic 10.3.6.
Grails version is 2.5.0 and java jdk1.7.0_79.
It works fine with jdk1.7.0_79 and grails 2.3.7.
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean prope
ty 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested excepti
n is java.lang.NoClassDefFoundError: oracle/xdb/XMLType
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1868)
Truncated. see log file for complete stacktrace
If I add xdb6.jar at the modules/lib..it doesn't pick that jar and still complains.
Any thoughts?

Related

Unable to run war file on Amazon EC2 instance

I am working on a spring boot application with latest Angular 7. I have created a build and generated war file.
I have configured a folder in this the structure is :
project-tool.war
config/application-prod.yml
config/application-dev.yml
config/application.yml
run.sh
run.bat
In run.sh/run.bat, these command written -> java -jar project-tool.war --spring.profiles.active=prod --spring.config.location=config\application-prod.yml
I have created Oracle database instance on AWS and put the configuration in application-prod.yml.
Then I have run this project using the war file on Windows OS, it works fine.
I have to run this war file on Amazon EC2 instance. So I have uploaded this folder on EC2 medium instance. As I run this, it throws an error :
2019-03-02 06:50:53.489 ERROR 3082 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityConfiguration': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in URL [jar:file:/home/ec2-user/theProject/project-tool.war!/WEB-INF/classes!/com/myProject/security/DomainUserDetailsService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'auditLogService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auditLogService' defined in URL [jar:file:/home/ec2-user/theProject/project-tool.war!/WEB-INF/classes!/com/myProject/service/AuditLogService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditLogRepository': Cannot create inner bean '(inner bean)#44dbafd9' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44dbafd9': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: IO Error: The Network Adapter could not establish the connection
2019-03-02 06:50:53.551 WARN 3082 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser.run(BlockSource.java:327)
2019-03-02 06:50:53.556 WARN 3082 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
I also have another instance and other project working (spring and angularJS) fine in a similar manner. But why this not working, is there any issue with the command or with angular?
How to work it on Amazon EC2?
Your problem here reading your error stack trace is the database connection. Pay attention to the core error message:
Failed to initialize pool: IO Error: The Network Adapter could not establish the connection
I don't know how the Oracle database is configured but probably you have a problem with database listener configuration or more simply whit the network communication between your EC2 and Oracle Database instance i can suggest to try to see on the security group and network configuration.
The problem is not Angular but the database link between your app and the database.

Can't manage run the completed Spring Yummy Noodle Bar tutorials

I'm trying to run the completed version of the Yummy Noodle Bar tutorials (REST + WebApp) locally, so that I can dig through the code a little bit on my 2*6hr bus rides this weekend.
http://spring.io/guides/tutorials/web/
http://spring.io/guides/tutorials/rest/
According to both guides, the finished code is available:
$ cd ../6/complete
$ ./gradlew tomcatRunWar
However, both versions do not run for me and give build errors.
Can anyone else manage to run these? Is there anything wrong with my Java version or Path?
2014-09-19 09:36:10 ERROR ContextLoader:319 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.setObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectPostProcessor' defined in class org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalStateException: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [com/yummynoodlebar/config/SecurityConfig.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

Error OracleAS and Hibernate

I have an application that use Spring and Hibernate.
Originally, I thought that this application would deployed on Tomcat, but, by requirements of customer, now I need deploy on Oracle AS 10g.
First, appear me the famous error:
XML-24509: (Error) Definición duplicada para: 'xxx',
and I solved with this, I put this on VM of the Server:
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
but now I have the following error:
/Users/hlopez/SPRING/sts-3.1.0.RELEASE/plugins/org.eclipse.jst.server.generic.oc4j_1.5.206.v20090812/buildfiles/oracle.10.1.3.xml:74: Deploy error: Operation failed with error:
Error creating bean with name 'analyzerConfigDAOImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/spring/mvc/servlet-context.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
I read about this, and a lot of people typed that, this error is caused for some .jars of hibernate,
I removed the hibernate-jpa-2.0-api-1.0.1.Final, but this caused more errors,
I have these .jars on my server:
adf-connections.jar
adfmtl.jar
adfui.jar
​dc-adapters.jar
adfbinding.jar
​adfcm.jar
​adfm.jar
adfmweb.jar
adfshare.jar
​bc4jct.jar
​bc4jctejb.jar
​bc4jdomorcl.jar
​bc4jimdomains.jar
​bc4jmt.jar
​bc4jmtejb.jar
​collections.jar
​commons-cli-1.0.jar
jdev-cm.jar
​ojmisc.jar
​regexp.jar
​share.jar
​xmlef.jar
​xsqlserializers.jar
concurrent.jar
mdsrt.jar
ordhttp.jar
ordim.jar
Help please, Thanks.

Using the stack trace from IDE to correct failing app

I request help making use of the following stack trace. Although this is a Groovy/Grails application, it still boils down to Java. In working along with the book 'Grails in action', I built an application in G/G, Grails v1.3.7. I imported this into the 'Spring Source Tools Suite', which uses Grails v2.2.3. It compiles fine, but won't run. Here is the first part of the stack trace (the entire thing is huge, but most of it just keeps repeating) ...
2013-10-17 16:28:16,074 [localhost-startStop-1] ERROR StackTrace - Full Stack Trace:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect];
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed;
nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData;
nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unsupported connection setting "SHUTDOWN" [90113-164])
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:122)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:713)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:457)
at org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:153)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:170)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127)
at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:121)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:107)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
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:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I latched on to the line that mentions:
(Unsupported connection setting "SHUTDOWN" [90113-164])
... it appears to be located in: ..\springsource\grails-2.2.3\src\java-addin\org\codehaus\groovy\grails\plugins\datasource\DataSourceGrailsPlugin.groovy in this call:
connection.createStatement().executeUpdate('SHUTDOWN')
This code comes with the IDE. Try as I might, I can't figure out what I might do to correct this problem. Tomcat problem? Any help is appreciated. Thanks in advance,

How to debug ContextLoader - Context initialization failed and BeanCreationException

I see a number of posts on the various problems folks have with troubleshooting this problem:
ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException:
Is there a way to turn on debugging to isolate the problem?
Its complaining about "No such property: getOrg for class: groovy.lang.MetaClassImpl" but that's not directly one one of our classes, is there some way to get info that's relevant to our codebase?
In our case we had a Grails 1.2.1 app deployed and running just fine in Tomcat. We then stopped Tomcat to do a DB backup and then restarted the app. The same WAR with no environmental changes(i.e, no config file changes, etc.) now throws this error. We had observed this behavior intermittently previously as well, but restarting used to fix the prob.
In our development environment, the same app runs just fine with "grails prod run-app" as well as "grails prod run-war".
The stacktrace snippets:
2010-09-30 12:10:13,391 ERROR
context.ContextLoader - Context
initialization failed
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'messageSource': Initialization of
bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'transactionManager': Cannot resolve
reference to bean 'sessionFactory'
while setting bean property
'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'sessionFactory': Invocation of init
method failed; nested exception is
groovy.lang.MissingPropertyException:
No such property: getOrg for class:
groovy.lang.MetaClassImpl
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
<<<<<<<< snip >>>>>>>>>>>>>>>>>>>>>>
Caused by: groovy.lang.MissingPropertyException: No such property: getOrg for class: groovy.lang.MetaClassImpl
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:485)
at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport.handleLazyProxy(HibernatePluginSupport.groovy:413)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindProperty(GrailsDomainBinder.java:2108)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.createProperty(GrailsDomainBinder.java:1829)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.createClassProperties(GrailsDomainBinder.java:1565)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindJoinedSubClass(GrailsDomainBinder.java:1272)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindSubClass(GrailsDomainBinder.java:1219)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindSubClasses(GrailsDomainBinder.java:1186)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindRoot(GrailsDomainBinder.java:1160)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindClass(GrailsDomainBinder.java:1040)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.secondPassCompile(GrailsAnnotationConfiguration.java:145)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
If you set logging level to DEBUG for packages org.springframework and org.codehaus.groovy then you will be able to get more details.
But in case of grails sometimes it helps just to stop tomcat, remove work and temp directories and start tomcat again.
I've gotten this in grails 1.3.4, and removing the tomcat work and temp directories ($CATALINA_BASE/temp, $CATALINA_BASE/work) does seem to fix the problem.

Categories

Resources