Hi everyone. Just trying to create an application that uses GWT for
the front end and Hibernate for the back end. I'm using Eclipse
Ganymede 3.4.0, GWT 1.5.2 and Hibernate 3.3.1 GA.
It's falling at the first hurdle. I've created a simple web page
which has a reference to the nocache.js file. The front end does a
GWT RPC call to the back end which loads data models using Hibernate,
translates the data to a simple RecordDataModel for transport back
again. The data is used to populate a ListBox.
The project is loosely based on the StockWatcher tutorial app, with
the RPC bits included. I created that and it worked fine.
When I try to run the application in hosted mode, the HTML loads, but
I get the error:
[WARN] Resource not found: com.app.gwt.client.Main.nocache.js; (could
a file be missing from the public path or a <servlet> tag
misconfigured in module com.app.gwt.Main.gwt.xml ?)
The www files are not generated, which I guess means that the code is
not being found or compiled. I've searched for the warning above but
there isn't much out there, so I hope theres something fundamental and
obvious I've missed. Does anyone have any ideas? Thanks in advance.
My project structure is like this (created using projectCreator and
applicationCreator):
project_1
+ src
+ com.app.gwt
+ public
Main.css
Main.html
Main.gwt.xml
+ com.app.gwt.bridge.client
ProviderTypeInfo
ProviderTypeService
ProviderTypeServiceAsync
+ com.app.gwt.bridge.server
ProviderTypeServiceImpl
+ com.app.gwt.client
Main
+ com.app.gwt.client.data
RecordDataModel (implements IsSerializable)
+ tomcat
....
Main-compile.cmd
Main-shell.cmd
Main.launch
The data models for the ProviderType and the Hibernate code is in a
seperate project, project_2, which is in the projects tab of the
Properties dialog for project_1.
These are my files:
Main.java
public class Main implements EntryPoint {
protected ListBox m_serviceTypeCombo;
protected HTMLTable m_providerTable;
protected ProviderTypeServiceAsync m_ptService;
/**
* This is the entry point method.
*/
public void onModuleLoad() {
// do the first panel
VerticalPanel l_firstPanel = new VerticalPanel();
m_serviceTypeCombo = new ListBox();
m_providerTable = new FlexTable();
ScrollPanel l_tableScroller = new ScrollPanel();
l_tableScroller.setWidget( m_providerTable );
l_tableScroller.setHeight( "80%" );
l_firstPanel.add( m_serviceTypeCombo );
l_firstPanel.add( l_tableScroller );
RootPanel l_root = RootPanel.get( "dataPanel" );
l_root.add( l_firstPanel );
loadServiceTypes();
}
protected void loadServiceTypes()
{
if( m_ptService == null )
{
m_ptService =
(ProviderTypeServiceAsync)GWT.create( ProviderTypeService.class );
}
AsyncCallback<RecordDataModel[]> l_callback = new
AsyncCallback<RecordDataModel[]>() {
public void onFailure(final Throwable p_caught) {
// display the error message above the watch list
String l_details = p_caught.getMessage();
DialogBox l_box = new DialogBox();
l_box.setText( "Error Loading Provider Service Types: " +
l_details );
RootPanel.get().add( l_box );
l_box.show();
}
public void onSuccess(final RecordDataModel[] p_aResult) {
m_serviceTypeCombo.clear();
for( RecordDataModel l_rec : p_aResult )
{
m_serviceTypeCombo.addItem( l_rec.getString( ProviderTypeInfo.PROVIDER_NAME ),
Integer.toString( l_rec.getId() ) );
}
}
};
// make the call to the stock price service
m_ptService.getProviderTypes( l_callback );
}
}
Main.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<title>Desktop Prototype</title>
<script type="text/javascript" language="javascript"
src="com.app.gwt.client.Main.nocache.js"></script>
</head>
<body style="width:100%;height:100%">
<div id="topPanel" style="max-height:200px;border:1px solid
red;">Top</div>
<div id="mainPanel" style="width:100%;height:100%">
<table style="width:100%;height:100%">
<tr>
<td style="min-width:200px;height:100%;border:1px solid
blue;">
<div id="leftPanel">Left</div>
</td>
<td style="width:100%;height:100%;border:1px solid black;">
<div id="dataPanel"/>Data</div>
</td>
<td style="min-width:200px;height:100%;border:1px solid
blue;">
<div id="rightPanel">Right</div>
</td>
</tr>
</table>
</div>
<div id="bottomPanel" style="max-height:100px;border:1px solid
red;">Bottom</div>
</body>
</html>
Main.gwt.xml
<module>
<!-- Inherit the core Web Toolkit stuff.
-->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change
-->
<!-- the theme of your GWT application by uncommenting
-->
<!-- any one of the following lines.
-->
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/>
-->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>
-->
<!-- Other module inherits
-->
<!-- Specify the app entry point class.
-->
<entry-point class='com.app.gwt.client.Main'/>
<servlet path="/getProviderTypes"
class="com.app.gwt.bridge.server.ProviderTypeServiceImpl" />
<!-- Specify the application specific style sheet.
-->
<stylesheet src='Main.css' />
</module>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---