Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EGL Development Tools » Trying to get EDT IBM i support to work
Trying to get EDT IBM i support to work [message #804926] Thu, 23 February 2012 06:34 Go to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
I thought I'd try to give EDT IBM i support a whirl before tomorrow's call and it mostly worked, at least from a source entry standpoint. However I did run into a couple of generation issues, both having to do with missing packages. The generated Java couldn't find either of these packages:

org.eclipse.edt.java.jtopen
eglx.jtopen

I'm not sure what I might have missed. All I did was update my EDT to the latest milestone:

EGL Web Developer Tools 0.8.0.v201202220747-1Co-(...)
EGL Web Developer Tools with Source Code 0.8.0.v201202220747-17F-(...)

I did create a new project to trst with. Do I have to create a new workspace?

Joe
Re: Trying to get EDT IBM i support to work [message #805242 is a reply to message #804926] Thu, 23 February 2012 14:39 Go to previous messageGo to next message
Joseph Vincens is currently offline Joseph VincensFriend
Messages: 31
Registered: December 2011
Location: Prospect CT
Member
Hi Joe,

This is a know issue with 0.8.0 M2 because we can't include the jt400.jar (yet) and the Java classpath of your new project does not include the EDT IBMi runtime.
I'm am working to get a CQ approved to include the jt400.jar with EDT IBMi, but that takes time.
So...
There are a few steps to configure the runtime.

  1. In the workspace with your new IBMi project check out dev.eclipse.org/cvsroot/tools/org.eclipse.edt/ibmi/org.eclipse.edt.runtime.java.jtopen. Make the following changes to it:

    1. Add the jt400.jar as an external jar to the libraries of the Java build path.
    2. Switch to the Java Classpath Order and Export tab end export the jt400.jar.
    3. Edit the manifest on the Build tab in the box Extra Classpath Entries remove build/dummy.com.ibm.as400.access.jar

  2. In the project that contains the IBMi functionality: add org.eclipse.edt.runtime.java.jtopen to the Projects tab of the Java classpath.



regards,
Joe
Re: Trying to get EDT IBM i support to work [message #805368 is a reply to message #804926] Thu, 23 February 2012 17:29 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 27
Registered: July 2009
Junior Member
Okay, closer. I am able to enter source that generates and compiles, but it doesn't run. I've got a simple IBMICONNECTION named MYI and my code is also very simple. I've got a library:
package server;

library IBMiLib

	function callProgram(input string)
	{
		@IBMiProgram {
			programName = "TEST1",
			libraryName = "/QSYS.LIB/CCIWEBTST.LIB",
			parameterAnnotations = [
				@AS400Text { length = 10 }
			]
		}
	} 
	end
	
end

And I've got a program:
package server;

import eglx.jtopen.jtopenconnection;

program Test1
	
	function main()
		mystring string;
		MYI IBMiConnection? {@Resource{}};
		call IBMiLib.callProgram(mystring) using MYI;
		Syslib.writeStdout(mystring); 
	end
	
end

This fails with the following error:
The value eglx.jtopen.JTOpenConnection@7f724a9d of type eglx.jtopen.JTOpenConnection cannot be converted to the type org.eclipse.edt.runtime.java.eglx.lang.EString.
eglx.lang.TypeCastException The value eglx.jtopen.JTOpenConnection@7f724a9d of type eglx.jtopen.JTOpenConnection cannot be converted to the type org.eclipse.edt.runtime.java.eglx.lang.EString.
	at eglx.lang.AnyException.fillInStackTrace(AnyException.java:187)
	at java.lang.Throwable.<init>(Throwable.java:181)
	at java.lang.Exception.<init>(Exception.java:29)
	at java.lang.RuntimeException.<init>(RuntimeException.java:32)
	at eglx.lang.AnyException.<init>(AnyException.java:32)
	at eglx.lang.TypeCastException.<init>(TypeCastException.java:24)
	at org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(EAny.java:125)
	at org.eclipse.edt.runtime.java.eglx.lang.EString.ezeCast(EString.java:59)
	at server.Test1.main(Test1.java:41)
(...)

And this is the generated code that causes the failure:
	public void main() {
		String mystring = "";
		IBMiConnection MYI;
		MYI = org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(SysLib.getResource("binding:MYI"), IBMiConnection.class);
		AnyBoxedObject<String> eze$Temp1;
		eze$Temp1 = org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeWrap(mystring);
		eze_Lib_server_IBMiLib().eze_callProgram_IBMiProxy(eze$Temp1, org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(SysLib.getResource(org.eclipse.edt.javart.util.JavartUtil.checkNullable(EString.ezeCast(MYI))), IBMiConnection.class));
		mystring = org.eclipse.edt.javart.util.JavartUtil.checkNullable(eze$Temp1.ezeUnbox());
		;
		SysLib.writeStdout(mystring);
	}
}

So there you go. It looks to me like the system is trying to call getResource to look up an IBMiConnection when it already has an IBMiConnection. In fact, it's trying to convert the connection to a string in order to lookup the connection.

At least that's what it looks like.
Re: Trying to get EDT IBM i support to work [message #805475 is a reply to message #805368] Thu, 23 February 2012 20:21 Go to previous messageGo to next message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 27
Registered: July 2009
Junior Member
As an update, I got it to work in a specific case: if I created a connection in the deployment descriptor, referenced it in the connectionResourceBindingURI of the @IBMiProgram annotation, and then called the function from my other program without using the USING keyword, then it worked. Also, you have to specify the library name in the deployment descriptor using the IFS naming conventions (/QSYS.LIB/mylibname.LIB).

Other syntactical variants fail for one reason or another, but this one works.
Re: Trying to get EDT IBM i support to work [message #806042 is a reply to message #805475] Fri, 24 February 2012 13:24 Go to previous messageGo to next message
Joseph Vincens is currently offline Joseph VincensFriend
Messages: 31
Registered: December 2011
Location: Prospect CT
Member
Hi Joe

I'm also using EGL Web Developer Tools 0.8.0.v201202220747, but I did not install source. When I installed I uninstalled and re-installed, I did not do an update.


  • I created a new project with both Client and services. The project I'm using was created with 0.8.0, but I'm not sure that makes a difference.
  • I created a library and a program with the same names as your example.
  • I copied your code into the parts

I'm getting:
	public void main() {
		String mystring = "";
		IBMiConnection MYI;
		MYI = org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(SysLib.getResource("binding:MYI"), IBMiConnection.class);
		AnyBoxedObject<String> eze$Temp1;
		eze$Temp1 = org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeWrap(mystring);
		eze_Lib_server_IBMiLib().eze_callProgram_IBMiProxy(eze$Temp1, MYI);
		mystring = org.eclipse.edt.javart.util.JavartUtil.checkNullable(eze$Temp1.ezeUnbox());
		;
		SysLib.writeStdout(mystring);
	}


In my code the connection is just passed which is what I expected to see. At 1 point in I2 we did allow the using to be a string, but that code was removed and only a connection is allowed.
Are the steps I've taken different that you?
Can you attach your project?

regards,
Joe
Re: Trying to get EDT IBM i support to work [message #806053 is a reply to message #806042] Fri, 24 February 2012 13:41 Go to previous messageGo to next message
Joseph Vincens is currently offline Joseph VincensFriend
Messages: 31
Registered: December 2011
Location: Prospect CT
Member
Hi

In a previous message I said to check out org.eclipse.edt.runtime.java.jtopen, which is correct, but now that we are committing changes for M3, you need to check out a specific version. IN CVS select versions, expand org.eclipse.edt, find org.eclipse.edt EDT080M2 then check out ibmi/org.eclipse.edt.runtime.java.jtopen.

To save you some trouble I'm attaching the correct version of org.eclipse.edt.runtime.java.jtopen and it already has been changed. You just need to import it into your workspace and change the jt400.jar location to the location on your machine.


regards,
Joe
Re: Trying to get EDT IBM i support to work [message #806290 is a reply to message #806053] Fri, 24 February 2012 19:53 Go to previous message
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
Joe, I'll try this as soon as I can. I'm excited to see this all work.

Joe
Previous Topic:Support for primitives
Next Topic:Eclipse IDE for EGL web Developers
Goto Forum:
  


Current Time: Thu Apr 18 23:37:51 GMT 2024

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

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

Back to the top