LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   error on deployment of war file in tomcat (https://www.linuxquestions.org/questions/linux-newbie-8/error-on-deployment-of-war-file-in-tomcat-917539/)

mlnm 12-07-2011 03:57 AM

error on deployment of war file in tomcat
 
Dear friends , i have build war file in eclipse through ANT script and copied war file to tomcat/webapps ans it extracted a directory, then i tried to open it through tomcat by opening web browser and typing in the address bar like this 192.168.1.x:8080/my war directory name, and it asks for login id and password and i gave them after that this error comes:

In order that the development team can address this error, please report what you were doing that caused this error.

The following information can help the development team find where the error happened and what can be done to prevent it from happening in the future.

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (null, message from server: "Host '192.168.1.111' is not allowed to connect to this MySQL server"); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (null, message from server: "Host '192.168.1.111' is not allowed to connect to this MySQL server")
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (null, message from server: "Host '192.168.1.111' is not allowed to connect to this MySQL server")
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy.getConnection(TransactionAwareDa taSourceProxy.java:107)
at com.ibatis.sqlmap.engine.transaction.external.ExternalTransaction.init(ExternalTransaction.java:53)
at com.ibatis.sqlmap.engine.transaction.external.ExternalTransaction.getConnection(ExternalTransaction. java:90)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.j ava:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:561)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:93)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:70)
at org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:224 )
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:165)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:222)
at com.proteam.emanage.workflow.UserIbatisDao.getUser(Unknown Source)
at com.proteam.emanage.workflow.LoginUserServiceImpl.getUser(Unknown Source)
at com.proteam.emanage.workflow.action.LoginAction.getUser(Unknown Source)
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:616)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.sql.SQLException: null, message from server: "Host '192.168.1.111' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1095)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:718)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
... 43 more

My server:rhel 5
tomcat:5.5.28
jdk:1.6
plz help ...

acid_kewpie 12-07-2011 06:25 AM

I'm concerned that you made no reference at all to the *very* clear message printed 3 whole times at the top
Quote:

message from server: "Host '192.168.1.111' is not allowed to connect to this MySQL server"
did you read it before pasting it all here??

configure your mysql server to permit your access.

mlnm 12-07-2011 01:51 PM

dear sir , i have read the error and found a few articles about allowing tomcat to connect to mysql database using jdbc connector, i have downloaded and placed jdbc in/commons/lib in tomcat folder. added following lines to /etc/server.xml :
<Resource name="jdbc/[YourDatabaseName]"
auth="Container"
type="javax.sql.DataSource"
username="[DatabaseUsername]"
password="[DatabasePassword]"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://[yourserver]:3306/[yourapplication]"
maxActive="15"
maxIdle="3"/>

And also added few lines in WEB-INF/web.xml
<resource-ref>
<description>[Your Description]</description>
<res-ref-name>jdbc/[YourDatabaseName]</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and still i got same error and posted it in forums plz send a step by step configuration .

hf2046 12-07-2011 02:19 PM

Did you create a user in your MySQL database with the same username and password that you specified in your server.xml file?

acid_kewpie 12-07-2011 04:33 PM

you have a MySQL issue NOT a tomcat issue. You need to understand what is relevant here. I don't understand how you've made a war file yet don't read the error messages. You should not expect a "step by step guide", you should think "Oh, my privileges are wrong on my database, let's look in a manual to see how to change that". Forget tomcat, just use the mysql client to simulate the connection and get logged in there first.

Additionally, as I have not been knighted by the Queen, I am not a Sir!


All times are GMT -5. The time now is 07:30 AM.