aspose file tools*
The moose likes GWT and the fly likes GWT in production mode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT in production mode" Watch "GWT in production mode" New topic
Author

GWT in production mode

sachin bal
Greenhorn

Joined: Mar 24, 2010
Posts: 9
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  71
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

Joined: Mar 24, 2010
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  71
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

Joined: Mar 24, 2010
Posts: 9
Hi,

The problem is resolved. Thanks for the help

Regards

Sachin
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  71
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

Joined: Mar 24, 2010
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  71
Good lesson about checking the log files first
sachin bal
Greenhorn

Joined: Mar 24, 2010
Posts: 9
I agree. :-) Thanks for all the help.

Regards

Sachin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GWT in production mode