Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » Error when connecting to IBM i(An exception occured during a service call)
Error when connecting to IBM i [message #879553] Thu, 31 May 2012 12:17 Go to next message
Billy Weeks is currently offline Billy Weeks
Messages: 6
Registered: May 2012
Location: Norcross, GA
Junior Member
I'm trying to follow the example in the video of connecting to an IBMi, I'm getting an error:An exception occured during a service call. Service:server.CallRpgService, Function:server.CallRpgService

I don't see any messages generated on the IBMi. My code seems to match the example that worked. Not sure where to look next to resolve it.

Server code is below:
	
package server;

// service
service CallRpgService


function hello (name string inout)
{
	@IBMiProgram {
	  programName = "MYRPG",  
	  libraryName = "/QSYS.LIB/BWEEKS.LIB/",
	  parameterAnnotations = [ @AS400Text { length = 40}
	  	],
	  	connectionResourceBindingURI = "binding:MyConnection"
	}

}
end
	
end


client code below:

package client;

// RUI Handler

import org.eclipse.edt.rui.widgets.GridLayout;
import org.eclipse.edt.rui.widgets.TextLabel;
import org.eclipse.edt.rui.widgets.GridLayoutData;
import org.eclipse.edt.rui.widgets.TextField;
import org.eclipse.edt.rui.widgets.Button;
import server.*;

//
//

handler CallRPGClient type RUIhandler{initialUI =[ui
            ], onConstructionFunction = start, cssFile = "css/MyIBM2.css", title = ""}

    ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children = [ varButton2, varErrorLabel, varButton, varNameField, varNameLabel ]};
    varNameLabel TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "Name" };
    varNameField TextField{ layoutData = new GridLayoutData{ row = 1, column = 2 }};
    varButton Button{ layoutData = new GridLayoutData{ row = 3, column = 2 }, text = "Go!", onClick ::= varButton_onClick };
    varErrorLabel TextLabel{ layoutData = new GridLayoutData{ row = 4, column = 2 }, text = " " };
    varButton2 Button{ layoutData = new GridLayoutData{ row = 3, column = 3 }, text = "Clear", onClick ::= varButton2_onClick };

    function start()
    end
    
    function varButton_onClick(event Event in)
    	call CallRpgService.hello(varNameField.text)
    		using new HttpProxy
    		returning to myCallbackFunction
    		onException myExceptionHandler;
    end
    
   function myCallbackFunction( name string in)
     varNameField.text = name;
   end
   
   function myExceptionHandler( exp AnyException in);
    varErrorLabel.text = exp.message;
  end
   
   function varButton2_onClick(event Event in)
   	varErrorLabel.text = "";
   	varNameField.text = "";
   end
end

Re: Error when connecting to IBM i [message #879657 is a reply to message #879553] Thu, 31 May 2012 15:39 Go to previous messageGo to next message
Joseph Vincens is currently offline Joseph Vincens
Messages: 31
Registered: December 2011
Location: Prospect CT
Member
Hi

The message details may help resolve the problem. Change your exception handler to include the details:
  function myExceptionHandler( exp AnyException in);
    SysLib.writeStdOut(exp.message);
    if(exp isa ServiceInvocationException)
      SysLib.writeStdOut("Detail1:" + (exp as ServiceInvocationException).detail1);
      SysLib.writeStdOut("Detail2:" + (exp as ServiceInvocationException).detail2);
      SysLib.writeStdOut("Detail3:" + (exp as ServiceInvocationException).detail3);
    end
  end


If this does not provide additional information about the exception, create a new service function hello2 and call it from the client. The new function will catch the exception and print the exception in the server console.
function hello2 (name string inout)
  try
    call hello(name);
  onexception(exp anyexcption)
    SysLib.writeStdOut(exp.message);
  end

end



regards,
Joe
Re: Error when connecting to IBM i [message #879680 is a reply to message #879657] Thu, 31 May 2012 16:18 Go to previous message
Billy Weeks is currently offline Billy Weeks
Messages: 6
Registered: May 2012
Location: Norcross, GA
Junior Member
THANKS !

That gave me the additional info I was missing.

The issue was that I renamed the project, and the deployment descriptor still had the previous name. The additional error message told me I didn't have default deployment descriptor.

Thanks again.

B.
Previous Topic:Error when opening 'HelloWorldView.egl'
Next Topic:Gridlayout in datagrid
Goto Forum:
  


Current Time: Thu Oct 23 21:20:12 GMT 2014

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

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