Home » Archived » EGL Development Tools » EGL Deployment(Not getting database )
EGL Deployment [message #906217] |
Fri, 31 August 2012 17:26  |
Eclipse User |
|
|
|
Desktop: Mac 10.6.8 EGL EDT 0.8.1
Deploying to host: CentOS 6.3 MySQL 5.1 Tomcat 6.0 Apache 2.4
I am trying my first deploy to a remote host from EDT EGL. I am deploying to a web project and then creating a war file from tomcat. When I ftp the file to the webapps folder in tomcat it explodes as expected. I am able to access a web page as expected.
I do not get data as expected.
I have one dedicated service that does all of my data access. I am not certain I understand the resource bindings in the deployment descriptor.
My service program connects with code as follows:
ProcessorMasterTable SQLDataSource? { @resource { uri="binding:NewMySQL"}};
NewMySQL is the name of the resource binding in the one and only deployment descriptor. I created a connection profile and have the radio button for connection profile checked. This deployment descriptor setting works during development and it works when the application is deployed locally.
For deployment to the host I do the following:
In the one and only deployment descriptor I check the radio button Specify Connection Information. Then I supply the following information:
SQL Database: not an enterable field so it is blank
JDBC Driver Class: com.mysql.jdbc.Drive
Connection URL: jdbc:mysql://ip-placed-here:3306/pinstruc
User ID: supplied
User Password: supplied
Default schema: supplied
Class locations: left blank
I then save the deployment descriptor and deploy. I am able to use the connection information supplied here to connect to the remote host via the MySQL workbench with no issue.
When I deploy as above I can bring up a page that should display a list of records in a grid. The page displays as expected and an activity circle appears in the upper left hand corner of the page but no records ever display.
If I modify this and supply:
Class locations: mysql-connector-java-5.1.17.jar
Then the page displays but I do not see the activity circle.
The noted jar file is in the tomcat install lib directory.
In all cases I have Connect using a JNDI data source NOT checked.
Questions.
1. Should I be placing the database name in the url connection?
2. Do I need to specify the entire path for the class location? I was assuming it would find it in tomcat.
3. Is my assumption correct that selecting Specify connection information the deployment would use this for the mysql connection given the way I have my service program set?
4. Is there a better way to accomplish what I am trying to do? Just want to specify how to connect to a MySQL database in deployed application.
Any help would be appreciated.
Thx,
Nathan Reed
|
|
|
Re: EGL Deployment [message #906443 is a reply to message #906217] |
Sat, 01 September 2012 09:47   |
Eclipse User |
|
|
|
Some additional information. I placed two text fields on the display.
appLocation is loaded with Step 1 just before my service call. It is loaded with Step 2 in my return function. It is loaded with Step 3 in the call allexception function.
appException is loaded with the exception id and exception message in the allexception funciton.
When this page is loaded from the host server the appLocation field is Step1Step3 indicating the call executed but resulted in an exception. The appException field is blank?
package client;
// RUI Handler
import org.eclipse.edt.rui.infobus.InfoBus;
import org.eclipse.edt.rui.widgets.Button;
import org.eclipse.edt.rui.widgets.DataGrid;
import org.eclipse.edt.rui.widgets.DataGridColumn;
import org.eclipse.edt.rui.widgets.DataGridLib;
import org.eclipse.edt.rui.widgets.GridLayout;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import org.eclipse.edt.rui.widgets.GridLayoutLib;
import org.eclipse.edt.rui.widgets.TextField;
import org.eclipse.edt.rui.widgets.TextLabel;
import common.Error;
import common.ProcessorMaster;
import dojo.widgets.DojoComboBox;
import dojo.widgets.DojoDialog;
import eglx.persistence.sql.Column;
import server.ProcessorServices;
handler ProcessorMasterList type RUIhandler {initialUI = [ listGrid ],onConstructionFunction = start, cssFile="css/CuttingInstructions.css", title="ProcessorMasterList"}
dbService ProcessorServices?;
dedicatedServiceBinding HTTPProxy;
ProcessorMasterDefinition ProcessorMaster[];
selectedRecord ProcessorMaster[] {};
ProcessorMasterList ProcessorMaster[];
listGrid GridLayout{
columns = 1, rows = 2, cellPadding = 4, children = [ ControlButtons, ProcessorMasterDefinition_ui ] };
ProcessorMasterDefinition_ui DataGrid {
layoutData = new GridLayoutData{ row = 1, column = 1 },
columns = [
new DataGridColumn {name = "PROCID", displayName = "Processor ID", width = 92,
alignment = DataGridLib.ALIGN_RIGHT, headeralignment = DataGridLib.ALIGN_CENTER},
new DataGridColumn {name = "PROCNAME", displayName = "Processor Name", width = 320, headeralignment = DataGridLib.ALIGN_CENTER},
new DataGridColumn {name = "PROCCONTNAME", displayName = "Contact Name", width = 320},
new DataGridColumn {name = "PROCCITY", displayName = "City", width = 120},
new DataGridColumn {name = "PROCSTPRV", displayName = "St/Prov", width = 60},
new DataGridColumn {name = "PROCSETUPDT", displayName = "Setup Date", width = 90, formatters = [ formatDate ]},
new DataGridColumn {name = "PROCSTATUS", displayName = "Status", width = 80, formatters = [setActiveInactive]}
],
behaviors = [ filters ],
headerBehaviors = [],
pagesize = 16,
selectionMode = DataGridLib.SINGLE_SELECTION,
selectionListeners ::= showOptions,
pageChangeListeners ::= hideOptions,
data = []
};
selectionDialog DojoDialog {
title = "Selection Options",
padding = 20,
backgroundColor = "lightblue",
draggable = true,
children = [selectionOptions]};
selectionOptions GridLayout{
layoutData = new GridLayoutData{ row = 1, column = 2 }, cellPadding = 4, rows = 4, columns = 1,
children = [ viewOption, changeOption, deleteOption] };
viewOption button{ layoutData = new GridLayoutData{ row = 2, column = 1 }, text = "View Selection", onClick ::= viewRequest };
changeOption button{ layoutData = new GridLayoutData{ row = 3, column = 1}, text = "Change Selection", onClick ::= changeRequest};
deleteOption button{ layoutData = new GridLayoutData{ row = 4, column = 1}, text = "Delete Selection", onClick ::= deleteRequest};
ControlButtons GridLayout{ layoutData = new GridLayoutData{ row = 2, column = 1,
horizontalAlignment = GridLayoutLib.ALIGN_LEFT }, cellPadding = 4, rows = 1, columns = 5,
children = [ appException, appLocation, filterPositionButton, addItemButton, printListButton ] };
addItemButton button{ layoutData = new GridLayoutData{ row = 1, column = 2 }, text = "Add Item to List", onClick ::= addRequest };
printListButton button{ layoutData = new GridLayoutData{ row = 1, column = 3 }, text = "Print List", onClick ::= printList };
filterPositionButton button{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "Filter/Position List", onClick ::= filterPositionRequest };
filterPositionDialog DojoDialog {
title = "Filter/Position Options",
padding = 20,
backgroundColor = "lightblue",
draggable = true,
children = [filterPositionOptions]};
filterPositionOptions GridLayout{
layoutData = new GridLayoutData{ row = 1, column = 2 }, cellPadding = 4, rows = 1, columns = 2,
children = [ statusFilterLabel, statusFilter ] };
statusFilter dojoComboBox{ layoutData = new GridLayoutData{ row = 1, column = 2 }, values = ["Active","Inactive","All"], value = "All", width = 80, onChange ::= setFilter};
statusFilterLabel TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text="Status Filter:" };
appLocation TextField{ layoutData = new GridLayoutData{ row = 1, column = 4 }};
appException TextField{ layoutData = new GridLayoutData{ row = 1, column = 5 }};
function start()
// processorList.designFile = "firstreport.rptdesign";
InfoBus.subscribe("addDone", getList);
InfoBus.subscribe("deleteDone", getList);
InfoBus.subscribe("changeDone", getList);
InfoBus.subscribe("viewDone", getList);
//ProcessorMasterList ProcessorMaster[];
applocation.text = "Step 1";
call dbService.getProcessorMasterList(ProcessorMasterList)
using new HTTPProxy
returning to RefreshTableData
onexception allException;
end
function getList(eventName string in, data any in)
ProcessorMasterList ProcessorMaster[];
if (data as decimal(11) != 0);
call dbService.getProcessorMasterList(ProcessorMasterList)
using new HTTPProxy
returning to RefreshTableData
onexception allException;
end
end
function refreshTableData(ProcessorMasterList ProcessorMaster[] in, ErrorRecord Error in)
applocation.text = applocation.text + "Step 2";
ProcessorMasterDefinition_ui.data = ProcessorMasterList as any[];
end // End function
function showOptions(grid dataGrid in)
selectedRecord = grid.getSelection() as ProcessorMaster[];
if (selectedRecord.getSize() == 1);
selectionDialog.showDialog();
end // End if
testing int = 1;
end // End function
function hideOptions(grid dataGrid in, oldPageIndex int in, newPageIndex int in)
ProcessorMasterDefinition_UI.deselectAll();
end // End function
function setActiveInactive(class string inout, value string inout, object any in)
testing int = 1;
if(value == "1")
value = "Inactive";
else
value = "Active";
end
end
function addRequest(event Event in)
selectNumber decimal(11) = 0;
InfoBus.publish("addRequest", selectNumber);
end
function changeRequest(event Event in)
selectNumber int = 0;
selectionDialog.hideDialog();
InfoBus.publish("changeRequest", selectedRecord);
ProcessorMasterDefinition_UI.deselectAll();
end
function deleteRequest(event Event in)
selectNumber int = 0;
selectionDialog.hideDialog();
InfoBus.publish("deleteRequest", selectedRecord);
ProcessorMasterDefinition_UI.deselectAll();
end
function viewRequest(event Event in)
selectionDialog.hideDialog();
InfoBus.publish("viewRequest", selectedRecord);
ProcessorMasterDefinition_UI.deselectAll();
end
function filterPositionRequest(event Event in)
filterPositionDialog.showDialog();
end
function formatDate( class string inOut, value string inOut, rowData any in )
value = stringLib.format(rowData.PROCSETUPDT as date, constants.usaDateFormat);
end // End function
function setFilter(event Event in)
filterPositionDialog.hideDialog();
eventName string = " ";
data int = 1;
ProcessorMasterDefinition_ui.render();
//getList(eventName, data);
testing int = 1;
end // End function
function filters(grid DataGrid in, cell Widget in, rowData any? in, dataIndex int in, column DataGridColumn in)
datafield int = 0;
if (statusFilter.value == "Active" && rowData.PROCSTATUS AS INT == 1)
tr Widget = cell.parent;
try
tr.parent.removeChild(tr);
onException(ex anyexception)
end End try
end // End if
if (statusFilter.value == "Inactive" && rowData.PROCSTATUS as int == 0)
tr Widget = cell.parent;
try
tr.parent.removeChild(tr);
onException(ex anyexception)
end // End try
end // End if
end // End function
function printList(event Event in)
// processorList.createReportFromDesign();
end // End function
function allException(ae AnyException in);
applocation.text = applocation.text + "Step 3";
appexception.text = ae.messageID + ae.message;
workfield int = 1;
end
end
|
|
| | | | | | | | | | |
Re: EGL Deployment [message #908549 is a reply to message #908526] |
Wed, 05 September 2012 10:53   |
Eclipse User |
|
|
|
Hi Nathan,
Sorry, I'm not being specific enough and may have made a massive assumption.
I created my web project from within the deployment descriptor editor, which sounds the same as you.
After I've deployed my application I then select export against my web project, by pressing right-click on the web project.
Export > WAR FILE
In your original post you mention that you do ...
file-->Export-->Web-->War
Now, here's my massive assumption, I was assuming that you were doing this against your EDT project, not your web project. Apologies, if you're still having problems and would like to rule out a problem with your tomcat installation, and are happy for me to do so then I'm happy to try installing the WAR file on my remote tomcat server.
Richard
|
|
| | | | | | | | | | |
Re: EGL Deployment [message #970974 is a reply to message #916180] |
Sun, 04 November 2012 08:27   |
Eclipse User |
|
|
|
This may help someone else deploying an application over a MySQL database.
I've been struggling for a while with a live deployment of my application running on tomcat6 and that accesses a mysql5 database.
The symptoms of the problem are that the application works fine during the day but when left idle overnight the first connection attempt the following morning causes the following sql error.
An exception has occurred: An exception occurred during a service call. Service:server.StocksService, Function:server.StocksService
Detail1:
Detail2:
Detail3: Exception: SQLService, getListID for list name:Unreviewed, SQLSTATE = 08S01, message = The last packet successfully received from the server was 51,217,745 milliseconds ago. The last packet sent successfully to the server was 51,217,748 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.: [sqlstate:08S01][sqlcode:0]
After much googling I found that the problem lay between the tomcat to mysql connection, and not the client as I initially thought.
There are a couple of pertinent settings on the mysql server, one called wait_timeout and the other called interactive_timeout, both of these had their default values of 8 hours.
I was using connection pooling on my tomcat server and this kept open a number of connections, ready for reuse. However, overnight mysql was closing off my connections
after they'd been unused for 8 hours but tomcat was then trying to reuse those connections and producing the errors.
To overcome the problem I add the following parameters to my context.xml file.
testOnBorrow="true"
validationQuery="SELECT 1"
validationInterval="30000"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
So, a sample file would look something like this ...
<Resource
auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="4"
maxIdle="2"
maxWait="5000"
name="jdbc/<mydb>"
password=<mypassword>
type="javax.sql.DataSource"
url="jdbc:mysql://<myurl>"
username=<myusername>
testOnBorrow="true"
validationQuery="SELECT 1"
validationInterval="30000"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
/>
I'm not 100% on the following but this works for me. The context.xml file is application specific and tomcat can host many applications so it looks as though the context.xml file is copied from the application folder to the conf/Catalina/localhost folder, so bear that in mind if the changes you make appear to have no effect.
Does anyone know if there is a way to make these changes permanent, within my EDT project? At the moment each time I redeploy my web app I need to remember to update the context.xml file.
Richard
|
|
| |
Goto Forum:
Current Time: Tue Mar 11 07:20:12 EDT 2025
Powered by FUDForum. Page generated in 0.06628 seconds
|