Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EGL Development Tools » Changed resource binding in 0.8.2 compared to 0.8.1 ?(Changed resource binding in 0.8.2 compared to 0.8.1 ?)
Changed resource binding in 0.8.2 compared to 0.8.1 ? [message #1003656] Mon, 21 January 2013 17:54 Go to next message
Wilfried Reinoehl is currently offline Wilfried ReinoehlFriend
Messages: 9
Registered: July 2012
Junior Member
Are there any changes in the resource binding from EDT 0.8.1 to 0.8.2?

I use this notation in the code

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

to get a SQLDataSource instance. i5DB is the name of a connection profile defined in the workspace. The .egldd file refers to it. i5DB is used to connect to an AS/400. The little test is written as a program part that is just started with "run as a main application". It works with EDT 0.8.1 but not with 0.8.2. The datasource contains always null, so I get a null pointer exception. I used a new workspace and created everything from scratch with the exception of the program source which I copied from the old workspace.

Any idea what's wrong here?

TIA,

Wilfried Reinoehl
Re: Changed resource binding in 0.8.2 compared to 0.8.1 ? [message #1003692 is a reply to message #1003656] Mon, 21 January 2013 20:08 Go to previous messageGo to next message
Richard Moulton is currently offline Richard MoultonFriend
Messages: 92
Registered: August 2011
Location: Devon, UK
Member
This page may help ...

http://wiki.eclipse.org/EDT:The_Differences_between_EDT_0.8.2_and_EDT_0.8.1#Changes_between_.8.1_and_.8.2_M3

Richard
Re: Changed resource binding in 0.8.2 compared to 0.8.1 ? [message #1003710 is a reply to message #1003692] Mon, 21 January 2013 21:06 Go to previous messageGo to next message
Wilfried Reinoehl is currently offline Wilfried ReinoehlFriend
Messages: 9
Registered: July 2012
Junior Member
Thank you Richard, I already checked this page but it does not help.

Is there anybody who made successful SQL accesses from EDT 0.8.2 to an AS/400?

TIA,

Wilfried Reinoehl


Richard Moulton wrote on Mon, 21 January 2013 15:08
This page may help ...

http://wiki.eclipse.org/EDT:The_Differences_between_EDT_0.8.2_and_EDT_0.8.1#Changes_between_.8.1_and_.8.2_M3

Richard

Re: Changed resource binding in 0.8.2 compared to 0.8.1 ? [message #1003733 is a reply to message #1003656] Mon, 21 January 2013 22:27 Go to previous messageGo to next message
Dan Darnell is currently offline Dan DarnellFriend
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member

Just ran a quick test and was successful. (Used a simple Rich UI though ... not a "run as a main application" approach.) No changes to my code or binding from 0.8.1 other than to include the now-required explicit imports.

Did you set up a connection under Window -> Preferences -> Data Management -> Connectivity -> Driver management?

--Dan
Re: Changed resource binding in 0.8.2 compared to 0.8.1 ? [message #1003884 is a reply to message #1003733] Tue, 22 January 2013 07:25 Go to previous messageGo to next message
Wilfried Reinoehl is currently offline Wilfried ReinoehlFriend
Messages: 9
Registered: July 2012
Junior Member
Thank you Dan. I already had a connection set-up.

I found a workaround with an alternative notation. So I am sure, that it is a bug.

// DOES NOT WORK.
//private ds SQLDataSource?{@Resource{uri = "binding:i5DB" } };

// WORKAROUND with alternative notation.
private ds SQLDataSource? =
Resources.getResource("binding:i5DB");


--Wilfried Reinoehl



quote title=Dan Darnell wrote on Mon, 21 January 2013 17:27]
Just ran a quick test and was successful. (Used a simple Rich UI though ... not a "run as a main application" approach.) No changes to my code or binding from 0.8.1 other than to include the now-required explicit imports.

Did you set up a connection under Window -> Preferences -> Data Management -> Connectivity -> Driver management?

--Dan
[/quote]
Re: Changed resource binding in 0.8.2 compared to 0.8.1 ? [message #1004223 is a reply to message #1003656] Tue, 22 January 2013 20:42 Go to previous message
Paul Harmon is currently offline Paul HarmonFriend
Messages: 11
Registered: July 2009
Junior Member
I received an NPE when running a quick test as well. There seems to be a bug where generation is not producing intialization code for global variables that specify the @Resource annotation. Variables that are defined local to a function and specify this annotation are generated correctly. I have opened a bug for this problem:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=398841

If your SqlDataSource variable is defined as global, you will need to use the Resources.getResource() workaround you mentioned. Alternatively, if you can move the variable into a function, it should generate correctly.

Sorry for the inconvenience,

Paul
Previous Topic:EDT 0.8.2 is finished!
Next Topic:@JSONName annotation
Goto Forum:
  


Current Time: Fri Oct 04 00:01:37 GMT 2024

Powered by FUDForum. Page generated in 0.03148 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top