Deployed application on Jboss and application throughs the exception Network Adopter
I have deployed the application in Jboss, which is Linux. I have kept the oracle-ds.xml in jboss. Database is pointing to my local machine. Now started the application, Server is up, JNDI is up and application is up. I tried login into the application which I deployed. There the problem I am getting. It says.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.jboss.util.NestedSQLException: Unable to get managed connection for OracleDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for OracleDS)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
oracle.jdbc.dbaccess.DBError.throwSqlException(开发者_运维百科DBError.java:179)
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:229)
org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:215)
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:648)
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:272)
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:690)
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:403)
org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:414)
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:116)
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:333)
$Proxy144.selectOne(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:154)
com.erudicus.model.dao.LoginDaoImpl.getUserDetails(LoginDaoImpl.java:22)
com.erudicus.model.service.LoginServiceImpl.getUserDetails(LoginServiceImpl.java:34)
com.erudicus.controller.LoginController.create(LoginController.java:69)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
Note : I have added ojdbc14.jar in Jboss Server/Server/default/deploy/lib folder. But it is not there in application lib folder.
I also tried putting the jar in application lib folder, but it didnt worked. Can any one please help.
First try to start the server without your application, just the oracle-ds.xml file, the datasource should be created and if there are connection problems, it should be shown there.
Also: Which JDBC-connection url are you using?
精彩评论