• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GWT in production mode

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We have created an application using GWT 2.5.1, Hibernate and our database is on MariaDB. We are using RequestFactory for fetching the data from server to the client. This application works fine in Development Mode. How do we convert this to production mode. We have done the following steps

1. Installed Tomcat on our machine
2. zipped the contents of the WAR directory and renamed it from ".zip" to ".war"
3. Copied the .war file into the Webapps folder of Tomcat
4. Started the Tomcat server

We are able to access the client side code using http://localhost:8080/<application name>, but, we are not able to access the MariaDB database. We have made changes in web.xml of the application folder in Webapps and added the following lines

<resource-ref>
<description>"<application name>"</description>
<res-ref-name>jdbc/db1</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

Also, we have added the following lines in context.xml which is present in conf folder of tomcat

<Resource name="jdbc/db1" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root"
password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/<application name>"/>

Unfortunately, we are still not able to connect to the database. Can someone please help me with this?

Regards

Sachin
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does "not able to" mean? What actually happens? If there are exceptions, post the full stack trace.

Also, why do you think this is a GWT problem?
 
sachin bal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thank you for the prompt response.

The first screen prompts the user for the user name and the password. The screen is displayed and we are able to enter the user name and the password. When we click on "Enter", the screen does not go on the next screen. When we do a right click and do an "inspect element" we are getting the following error

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:8080/RBIComp/gwtRequest
Uncaught #<error> localhost:8080/RBIComp/com.example.myproject.RBICompliance/CCBAFE5EF5C818536F0E6FB32882E2C0.cache.html:1908


I am not assuming that this is a GWT problem, but, I would like some help so that I would be able to run this application in the production mode.

Hope this answers your queries.

Regards

Sachin
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am not assuming that this is a GWT problem.


I see. I assumed you did because you posted in the GWT forum, not in the JDBC forum (which would be the natural place for DB problems).

So what makes you think this is a DB problem, then? The error message does not say anything about any DB.

A 500 error should cause a stack trace to be logged in the server logs, though - post that here.
 
sachin bal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The problem is resolved. Thanks for the help

Regards

Sachin
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to hear it. Care to tell us what the problem was, and how it was resolved? That would help others in the future who have a similar problem.
 
sachin bal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure. We went through the logs and noticed java.lang.ClassNotFoundException for a 3 classes. We added the relevant jar files to the <project name>/war/WEB-INF/lib, recompiled the program and the problem was resolved.

Regards

Sachin
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good lesson about checking the log files first
 
sachin bal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree. :-) Thanks for all the help.

Regards

Sachin
reply
    Bookmark Topic Watch Topic
  • New Topic