Home » Archived » EGL Development Tools » EGL Deployment(Not getting database )
|
Re: EGL Deployment [message #906443 is a reply to message #906217] |
Sat, 01 September 2012 13:47 |
Nathan Reed Messages: 74 Registered: June 2012 |
Member |
|
|
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 14:53 |
Richard Moulton Messages: 92 Registered: August 2011 Location: Devon, UK |
Member |
|
|
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 13:27 |
Richard Moulton Messages: 92 Registered: August 2011 Location: Devon, UK |
Member |
|
|
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: Mon Oct 14 22:11:39 GMT 2024
Powered by FUDForum. Page generated in 0.07090 seconds
|