• Post Reply Bookmark Topic Watch Topic
  • New Topic

Migrating app from tomcat 7 to 8 with connection to MS SQLServer  RSS feed

 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have, in the company I am working with, a Tomcat 7 application thant deploy a connection to a Microsoft SQL. A new server with Windows server 12 and another DB server with a new SQL, both are ready for migrating the application. I installed (Java and) Tomcat 8 and tried to establish the connection with the Database server with the new SQL, but it didn't work. I need to know what should be done with Tomcat server and with Microsoft SQL.
Thanks
 
Tim Cooke
Marshal
Posts: 3699
197
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're going to need to give us a bit more of a clue about your problem than "but it didn't work". Do you have an error message? What's happening that you don't expect? What's not happening that you did expect?
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Exception with (unknown source) even thohgh in the dump it is listed that the parameter file, that contains the IP of the Microsoft SQL server, is read
 
Tim Cooke
Marshal
Posts: 3699
197
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Exception? Can you copy it here for us to see?
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help. It is IOException (Null pointer)
 
Tim Cooke
Marshal
Posts: 3699
197
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you paste the whole Stack Trace? There's probably some important clues in there that'll help identify your problem.
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This I can do tomrrow morning. But the <resource ... is read and the message tels that the driver...SQL class try to open with (Unkown source). I have a question, is there any thing should be done on the server side? or is there a SQL client that should be installed in the Tomcat app server? I doesn't work with Microsoft, personally. The company is using Windows and Microsoft SQL. So, I don't know what to do with SQL.
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dump:
Error:
java.lang.NullPointerException
Stack Trace:
java.lang.NullPointerException at com.teknicaltd.moz.util.writer.SQLExecutor.setAutoCommit(Unknown Source) at com.teknicaltd.moz.util.writer.SQLExecutor.executeSQL(Unknown Source) at com.teknicaltd.moz.util.writer.SQLExecutor.executeSelect(Unknown Source) at com.teknicaltd.moz.navigate.CheckUserInfo.validateUser(Unknown Source) at com.teknicaltd.moz.navigate.CheckUserInfo.doPost(Unknown Source) at com.teknicaltd.moz.navigate.CheckUserInfo.doGet(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
 
Dave Tolls
Ranch Hand
Posts: 2554
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
com.teknicaltd.moz.util.writer.SQLExecutor.setAutoCommit(Unknown Source)

Is that your companies code?

I don't recognise the package.
 
Tim Cooke
Marshal
Posts: 3699
197
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like Dave says, that looks very much like a package containing code belonging to you or your company.

Can you share the contents of the SQLExecutor.setAutoCommit() method? Perhaps we can identify some possible candidates for a NPE. Alternatively you can set a debug breakpoint on that method and inspect it yourself to identify what object is null when it shouldn't be.
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim and Dave. The application was done by other company. I've been asked to adjust the app for them. they used to have Windows 8 and SQL 5, because of this they are facing a limitation with storage. They want to use new Windows and SQL 2012. What I found are just jar files with the descripting files. The app is not located within the "webapp" directory, to say. They used to use Tomcat 7 and now I installed in the new server Tomcat 8. When I copied the app and changed the IP number of the database server to the new one and started the app I got the exceptions and moved to the login screen with no text boxes for user name and password. I am still working on the description file (there are some parameters that should be changed, as I found in migrating from 7 to 8) and I will share with you. Meanwhile, if you have any idea or suggesion will you pass it to me.
 
Dave Tolls
Ranch Hand
Posts: 2554
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need the source code to figure out where exactly it is going wrong, otherwise you'll be blindly trying to fix this, and that rarely works well.
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran the configtest.bat and read the resulted list. I made a progress by re-reading descriptors files and correct some imports for old classes from previouse Tomcat versions. I used Tomcat migration guide to trace changes from Tomcat 5 to Tomcat 8.
Now the last SEVER is:
[main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [connector[AJP/1.3]]
I will re-read server.xml and other descroptors that include descriptions about AJP. I will post updates, meanwhile I am appreciating advices.
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could move a littel. The set up is as follows:

E:\MyProject\MyApp\ProjName\ all application files and directories (including WEB-INF)

E:\MyProject\TomcatServer\Tomcat8\apache-tomcat\ all Tomcat 8 files and directories

In $CATALINA_HOME\conf\[Engine]Catalina\[Host]localhost\ all xml files for applications located outside webapps directory

One of the files named ProjName.xml includes <Context docBase="E:\MyProject\MyApp"> with this I can see the PorjName in the applicatin list of Tomcat manager (GUI) but when I click on it the 404 page comes up.
Also, and according to the documentation what should be, when I add "\ProjName" to the docBase the Tomcat 8 (because I restare it) won't start !!!
Any idea how to fix this?
 
Mohammed Alghwell
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found in the $CATALINA_HOME\conf\web.xml a mistake, there is a commented <!--Filter> while the <filter-mapping> is not commented. I just comment it and fixed the docBase to include \ProjName, so things went OK partialy. This because the applicaiton index file is "index.shtml" and when I put the URL "localhost:8080\ProjName the contents of the file is displayed (chrome browser)!!. I checked the SSI tags in web.xml I found commented filter tags. When I checked the old tomcat 5, which was used by the application, I found commented servlet tags but I couldn't find any mentioning for SSI. So, how I can activate the index.shtml without uncommenting SSI tags? Note: in the application web.xml there is a tag <welcome-page>index.shtml</welcome-page>
Thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!