Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » EGL Deployment(Not getting database )
EGL Deployment [message #906217] Fri, 31 August 2012 17:26 Go to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
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 Go to previous messageGo to next message
Nathan Reed is currently offline 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 #906445 is a reply to message #906217] Sat, 01 September 2012 09:53 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
sorry for the double post

[Updated on: Sat, 01 September 2012 09:55]

Report message to a moderator

Re: EGL Deployment [message #906870 is a reply to message #906445] Sun, 02 September 2012 16:48 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
Hi Nathan,

I don't know if this helps but I have a MySQL database connection working successfully from a remotely hosted EDT web application; the MySQL database is also remotely hosted.

Within my resource binding configuration for my database I have the 'Use a connection profile' radio button selected and have not needed to use the connection information that you've specified.

I installed the mysql-connector-java-5.0.8-bin.jar file to my remote apache-tomcat-6.0.35/lib directory.

Richard
Re: EGL Deployment [message #906874 is a reply to message #906870] Sun, 02 September 2012 17:03 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Thanks, will give that a try.

Do you know if there is a way to edit the connection profile. It seems the only way to make a simple change is to delete the profile and re-enter it.

I just cannot seem to understand why DB connections have to drag us through so much minutia.

Thanks for the input,

Nathan Reed
Re: EGL Deployment [message #906879 is a reply to message #906874] Sun, 02 September 2012 17:16 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
Hi Nathan,

I'm a big fan of the database development perspective and it's from here that you can edit the connection profile information.

Simply right-click on the required profile, within Database Connections, and then click on Driver Properties.

Richard

Re: EGL Deployment [message #907152 is a reply to message #906879] Mon, 03 September 2012 08:00 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Thx much. I now have a grip on connections and how to maintain. I am a bit slow and am trying to learn several dozen tooling issues at once. You have been most helpful. I also appreciated you getting the information on array definition in another post. I have a few hours invested in that issue and that was most helpful.

I am able to use DB perspective to gain connection to the remote. I have had connection all along from MySQL workbench.

I think I must have a Host configuration problem.

It would be helpful (for the ignorant neophyte) if the EGL documentation on deployment description and connectivity mentioned that connection profiles can be maintained via the data perspective.

Nathan Reed
Re: EGL Deployment [message #907378 is a reply to message #907152] Mon, 03 September 2012 17:56 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
I know what you mean about the connection profile maintenance, it took me a while to find it. I'm guessing that the DB perspective is not a part of EDT but is a standard perspective available within Eclipse, thus there's no specific EDT documentation for this.

I know the EDT team are busy finishing the extensible compiler capabilities of the tooling but if asked where I'd like to see improvements then I'd say documentation and enriching the widget set.

Richard
Re: EGL Deployment [message #908479 is a reply to message #906217] Wed, 05 September 2012 09:00 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

If you are still watching this thread I have a question.

I am using file-->Export-->Web-->War file to export a war file from eclipse after i deploy it to a dynamic web project.

I do not have great deal of experience in a linux/java environment so have got some experienced java help to assist with trouble shooting. Based on the mysql logs we have validated the connection credentials are working but are still getting a elg0024e return error. The db was built from an export of my local db so I do not believe I have minor definition issues.

I believe you are accessing mysql similar to how I am doing it. Are you using the same approach to creating the .war file? I would like some confirmation that my approach to deployment to the host is expected to work. My deployed app works fine locally.

Any input would be appreciated.

Thx,

Nathan Reed

Nathan Reed
Re: EGL Deployment [message #908488 is a reply to message #908479] Wed, 05 September 2012 09:23 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
Aha, no that's not what I'm doing.

Within my EDT project deployment descriptor I've specified a target web project, which in my case is targeting a tomcat6 server.

Once I've deployed my EDT project I then perform an Export > WAR file against my web project, not my EDT project.

I think that's the missing link.

Let me know how you get on.

Richard
Re: EGL Deployment [message #908516 is a reply to message #908488] Wed, 05 September 2012 10:06 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Sorry but I want to make sure I understand.

How did you create the Target Web Project? Did you just create via New-->Other-->Server-->Server and select tomcat6. Actually create a new server and deploy to that server and them create .war from the server?

I created a Dynamic Web Project New-->Other-->Web-->Dynamic Web Project and then specified the tomcat6 server within that.

Sorry but it just does not seem logical to my old brain. Trying to understand.

Appreciate the help.

Nate....
Re: EGL Deployment [message #908526 is a reply to message #908516] Wed, 05 September 2012 10:24 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

To be more specific I actually used the new button within the deployment descriptor (target project) and it defaults to a dynamic web project. I then used the tomcat6 server and other defaults.

This looks to be the same as what I outlined above.

Thx much,

Nathan Reed
Re: EGL Deployment [message #908549 is a reply to message #908526] Wed, 05 September 2012 10:53 Go to previous messageGo to next message
Richard Moulton is currently offline 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 #908581 is a reply to message #908549] Wed, 05 September 2012 11:49 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Thanks much and no need for sorry. I really appreciate being able to validate what I was doing.

That is a very kind offer. I have a couple of more things I am going to try. If I do not make progress I will give that some consideration. That may help.

Thx again,

Nathan Reed
Re: EGL Deployment [message #910971 is a reply to message #908581] Mon, 10 September 2012 14:15 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

I assume you are NOT using JNDI. Is that correct?

Thx,

Nathan Reed
Re: EGL Deployment [message #911515 is a reply to message #910971] Tue, 11 September 2012 15:09 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
Hi Nathan,

My sql resource binding has the following settings.
Use a connection profile is selected, my connection profile name is stocksdb.
Connect using a JNDI data source is ticked.
JNDI name is jdbc/stocksdb.
Use application-based authentication is not ticked.

My connection profile has the following settings.
My database name.
URL is jdbc:mysql://<hostname>:3306/<database>
My user name and password.
Save password is ticked.

I'm using the mysql-connector-java-5.0.8-bin.jar.
The MySQL server version is 5.5.21-55.
The tomcat version is 6.0.35.

Hope that helps.

Richard
Re: EGL Deployment [message #911528 is a reply to message #911515] Tue, 11 September 2012 16:07 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Very helpful. I have not been using JNDI for local or host. I tried it local and notice no difference. Local performs very well with or without.

I tried it on my host and it improved things a bit. I am not familiar enough with JNDI to know if I really need it for my simple application? Does EGL force a situation where JNDI is required? I will probably need to change tomcat configuration to actually employ JNDI but am not sure why I would do that. If it runs on local with no JNDI then there should be a configuration that will run on the host with no JNDI.

Probably a configuration issue on my host tomcat.

WARNING - Rant starting

I certainly will never come to understand how we can be in 2012 (12% of the way in to the 21cst century) and we are still playing cat & mouse games with connectivity. It simply seems insane for so many people to spend so much time trying to get a record out of a database. In all cases that I have witnessed there is a computer involved. Beyond supplying security credentials I cannot imagine why my involvement is required. The servers should simply negotiate a connection contract and PLEASE leave me alone. For those with big DB issues the developers could certainly spend forever providing endless panels of esoteric parameters to fine tune the world. But in reality I bet over 90% of the issues would be handled with simple defaults.

I used to believe that these issues were due to my ignorance and lack of experience with the tools and how they worked. But I no longer impale myself on that nonsense. JDBC has been around for over 15 years and during that time I have watched countless efforts by 100s of people with a wide range of skill sets and experience try to get connections established. Keying in some parameters and then having a computer bark back logs that require hours of experience to learn how to read. Experience that rarely gets used. And of course you have to know how to turn on the logs and what logs to turn on. And where to direct them and on and on and on.

Seven different technicians with varying backgrounds have looked into this problem. This is an off-the-shelf install on the host machine with no known altered configurations. And we cannot get a simple connection to MySQL. Or even determine what the issue is.

I believe it is way past time for both the proprietary and open-source tool developers to address these issues. I am not in any way picking on the folks working on EDT EGL. I appreciate what I paid for this product and understand the process. I just think it is time we quit accepting that getting two servers to have a conversation will just naturally require some endless litany of esoteric parameters to be supplied by some application developer who has no idea what is required. An application developer who could probably be spending some time understanding a customers problem. In each and every case where two servers need to converse I have noticed that a computer is available. Every single case. I vote that we start using the computers to abstract this garbage.

END OF RANT But not my last on this topic.

Thanks for the input Richard. I do believe this is probably some simple config issue. Will let you know what I learn. Hopefully I can save someone else some time down the road.

Nathan Reed

Re: EGL Deployment [message #911849 is a reply to message #911528] Wed, 12 September 2012 08:55 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

I note that you do not use application based authentication.

I assume that means your tomcat server configuration was modified to provide authentication. Can you confirm my assumption?

Also, do you know has your tomcat configuration been modified to address JNDI?

I have been assuming that if you use JNDI the APPLICATION META-INF-->context.xml file would provide the db connection credentials and no tomcat modification would be required. But it is easy to get lost in all the options here (container based, application based, server based, etc) and I may not understand.

Thx,

Nathan Reed
Re: EGL Deployment [message #911961 is a reply to message #911849] Wed, 12 September 2012 12:49 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Hope you do not mind another question.

I am accessing db in my dedicated service as follows:

[code]ProcessorMasterTable SQLDataSource? { @resource { uri="binding:NewMySQL"}};/code]

This works with no issue locally.

I noticed in a blog entry by Justin back in April he does it this way:

[code]ds SQLDataSource = SysLib.getResource("binding:DerbyConnection");
add newRecord to ds;/code]


How are you doing this?

Thanks,

Nathan Reed
Re: EGL Deployment [message #912052 is a reply to message #911961] Wed, 12 September 2012 17:30 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
Hi Nathan,

I'm creating a connection using the following syntax, so the same as you.

ds SQLDataSource? { @Resource { uri="binding:stocksdb" } } ;

I'm not performing any form of authentication on tomcat and I've not changed my tomcat configuration to handle JNDI.

I was curious so I tried something this afternoon, which I'm willing to share if I can work out how to send a private message.

I took the "Access a database with EGL Rich UI" tutorial from the EDT website and made this work over a MySQL database rather than a Derby database. OK, I did run in to a few problems, one of which I was able to correct and one of which I had to fudge but the application runs and provides proof of accessing a MySQL DB.

I installed this on my remote tomcat server and it worked first time. I then installed a new version (6.0.35) of tomcat locally and other than copying the mysql-connector-java-5.0.8-bin.jar file in to my new tomcat installation (the lib directory) I didn't change a thing.

It should be noted that my remote tomcat server is as provided by my service provider so they may have tweaked the config but it worked out of the box on my new local tomcat installation.

I'm happy to share the .war file (7mb) with you that includes the connection to my remote MySQL database that I know to be working. That may help eliminate your tomcat installation.

How do you send a private message on this forum?

Richard
Re: EGL Deployment [message #912073 is a reply to message #912052] Wed, 12 September 2012 18:20 Go to previous messageGo to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Richard:

Some good news. I found the problem.

My host admin found a tdl error in the tomcat logs. That resulted in wondering why these paths were broken. That led to a forum and that led to replacing GCJ java with JDK java and everything worked with no issue. And it works just fine with JNDI.

Not sure why my host had gcj installed. That appears to be a dead animal.

Inexperience is very expensive in this stuff. This will be the end of my tomcat/mysql connectivity lesson until I have a problem or need and I will have lost most of my knowledge skill from these last three weeks. Lost investment. I will never get my money back on that time. And that is why it needs to be continually abstracted. I will note that the edt egl team has done some of that with regards to egl. The deployment descriptor takes a while to get a grip on but it works and the jndi deployment is nice in that I am NOT involved.

Not sure about the general configuration/set up of jndi with regards pooling etc. but it functions.

Richard thank for those efforts. I do not mind sharing my email nathanreed@sunflower.com

Feel free to contact me.

Thx very much for the help. Most kind.

Nathan Reed
Re: EGL Deployment [message #912232 is a reply to message #912073] Thu, 13 September 2012 03:16 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
Wow, I wouldn't have thought of the server java installation but I'm glad it's sorted.

Richard
Re: EGL Deployment [message #916180 is a reply to message #912232] Tue, 18 September 2012 13:02 Go to previous messageGo to next message
Richard Moulton is currently offline Richard Moulton
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
For future reference, and just in case anyone is remotely interested, I stumbled upon this blog entry about JNDI.

http://xeglblog.blogspot.co.uk/2012/04/accessing-your-database-with-jndi.html

Richard
Re: EGL Deployment [message #970974 is a reply to message #916180] Sun, 04 November 2012 08:27 Go to previous messageGo to next message
Richard Moulton is currently offline 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
Re: EGL Deployment [message #1220396 is a reply to message #906217] Wed, 11 December 2013 08:41 Go to previous message
hils Raza is currently offline hils Raza
Messages: 6
Registered: December 2013
Junior Member
Thank you so much.. It helped me Wink
Previous Topic:egl future
Next Topic:Eclipse EDT dojo toolkit
Goto Forum:
  


Current Time: Thu Aug 21 14:06:29 EDT 2014

Powered by FUDForum. Page generated in 0.02318 seconds