I am trying to run Tomcat with web-matrix.war, but I can not.
I am look at log file and see exception:
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 'lobHandlerDetector' while setting bean property 'lobHandler';
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'lobHandlerDetector': Invocation of init
method failed; nested exception is
org.springframework.jdbc.support.MetaDataAccessException: Error while
extracting DatabaseMetaData; nested exception is
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null' at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
..............................................
Caused by: java.lang.NullPointerException at
sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:524) at
sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:493) at
sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at
java.sql.DriverManager.getDriver(DriverManager.java:262) at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
My settings are:
/usr/share/apache-tomcat-7.0.55/conf/Catalina/localhost/web-matrix.xml
<Context path="/web-matrix" reloadable="true">
<Resource
name="jdbc/webmatrix"
auth="Container"
type="javax.sql.DataSource"
username="webmatrix"
password="webmatrix"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:#spb-fusion02:1521:orcl"
/>
</Context>
Does anyone help me?
I've checked the connection with listener. It's good.
[root#spb-fusionwm02 localhost]# /opt/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnsping spb-fusionwm02:1521/orcl
TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 30-SEP-2014 09:22:17
Copyright (c) 1997, 2011, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=orcl))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.82.64)(PORT=1521)))
OK (10 msec)
in driverClassNamee try :
oracle.jdbc.driver.OracleDriver;
I think the url you are passing to it is not proper so that's why you are getting problem.
where's the oracle DB server reside ?
On your machine or other ?
The error shows that the source / url is null.
Related
I'm using WebLogic 12.2.1.4, I have already created the datasource with the name "jdbc/TESTDataSource but still getting the below error. Is there are any additional steps that I'm missing here. Please help.
Caused by: org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureException: Failed to look up JNDI DataSource with name 'java:comp/env/jdbc/TESTDataSource'; nested exception is javax.naming.NameNotFoundException: While trying to look up comp/env/jdbc/TESTDataSource in /app/webapp/TEST.war/1431676420.; remaining name 'comp/env/jdbc/TESTDataSource'
I am migrating my spring jsf project from ANT to maven, while deploying in jboss 5 server getting below error.
ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'propertyLoaderJob' defined in ServletContext resource [/WEB-INF/property.xml]: Cannot resolve reference to bean 'propertyloader' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'propertyloader' defined in ServletContext resource [/WEB-INF/property.xml]: Cannot resolve reference to bean 'dataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/DataSource.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: fsmDS not bound
The exception means that JDBC driver is missed.Please check if you have JDBC driver dependency in pom.xml.
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.
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>
i am using spring 3.2.0 with ibatis 2.3.4 in weblogic 10.3.6
while deploying in weblogic.
I am getting this NoSuchMethodError as below:
User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gatewayService' defined in ServletContext resource [/WEB-INF/applicationContext-granite-webservice.xml]: Cannot resolve reference to bean 'daoIPInventory' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoIPInventory' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gatewayService' defined in ServletContext resource [/WEB-INF/applicationContext-granite-webservice.xml]: Cannot resolve reference to bean 'daoIPInventory' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoIPInventory' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
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)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoIPInventory' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Cannot resolve reference to bean 'sqlMapClient' while setting bean property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
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)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/applicationContext-ip-ibatis-db.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
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)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NoSuchMethodError: com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(Ljava/io/InputStream;Ljava/util/Properties;)Lcom/ibatis/sqlmap/client/SqlMapClient;
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:339)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
Truncated. see log file for complete stacktrace
Looks like Spring 3.2 is not compatible with iBatis 2.3.4.
In iBatis 2.3.4 SqlMapConfigParser has no method #parse(InputStream, Properties), but in newer version myBatis 2.3.5 it is exist.
Probably problem also in MyBatis-Spring library version.
Nevertheless you should update version of myBatis or find appropriate version of Spring or Spring-iBatis integration.
Check whether you have ibatis jar file and mysql-connector jar file in your project. and your controller class name should not be controller.java
Check whether you have ibatis jar file and mysql-connector jar file in your project. and your controller class name should not be controller.java
your sqlmap namespace name should be unique for each sqlmap file which you have written in sqlMapConfig.xml
In your sqlmap file, all tag should be clearly defined. you should mention parameterClass and resultClass. Must not leave as empty one, like this.
select id="sampleid" parameterClass="" resultClass=""
Your query
select id="sampleid"
Your quer
Looks like the ibatis jar which you are using does not have parse method with those arguments. Decompile and see if the jar has parse the method which code is looking for.