Skip to main content
1-Visitor
August 14, 2010
Question

ObjectWebject.invoke() exception

  • August 14, 2010
  • 1 reply
  • 800 views
I am trying to invoke a webject, using SAK classes from a Java program. Like so:

com.infoengine.SAK.ObjectWebject ow = new com.infoengine.SAK.ObjectWebject();
ow.setService(ieService);
ow.setUserName("xx");
ow.setPassword("xx");
ow.setName("Query-Objects");
ow.setParam("INSTANCE", "xx");
ow.addParam("DBUSER", "xx");
ow.addParam("PASSWD", "xx");
ow.setParam("TYPE", "WCTYPE|wt.doc.WTDocument|com.abc.def");
ow.setParam("WHERE", "Name=*");
ow.setParam("ATTRIBUTE", "name, number, Assy_or_Part_or_Fixture_Reference");
ow.setParam("GROUP_OUT", "RDocs");
ow.invoke();

This gives the following exception:

2010/08/13-20:40:42.338#:#INS002922#:#-IE-#:#java.lang.NullPointerException
at com.infoengine.procunit.adapter.Adapter.receive(Adapter.java:480)
at com.infoengine.procunit.webject.WebjectProcessor.routeWebject(WebjectProcessor.java:495)
at com.infoengine.procunit.webject.WebjectProcessor.processTask(WebjectProcessor.java:106)
at com.infoengine.SAK.Webject.invoke(Webject.java:324)
at com.infoengine.SAK.ObjectWebject.invoke(ObjectWebject.java:96)
at com.infoengine.SAK.ObjectWebject.invoke(ObjectWebject.java:69)
at dab.TestWebjects.main(TestWebjects.java:60)


I gather, from looking at the code that Windchill is looking for an object input stream from which to read BLOBS. I am guessing it has something to do with the webject being invoked from an external program.
Can anyone tell me how to fix this problem?

Thanks,

Derek

1 reply

10-Marble
August 16, 2010
Hi Derek
I am no expert, but have used the IeService object in the SAK interface,
like this:
ie = new IeService();
ie.setServerUri("

ie.setCredentials("xx","yy");
try
{
ie.beginRequest("Query.xml");
ie.sendParameter("typeIdentifier", "wt.pdmlink.PDMLinkProduct");
ie.sendParameter("criteria", "name='my product");//Edit to your
product name
ie.sendParameter("SUPPORTING-ADAPTER",
"com.ptc.icenterv01.Windchill" );//Edit adapter to your installation
ie.sendParameter("containerUFID", ");
ie.sendParameter("propertyNames", "obid");
ie.sendParameter("output", "mygroup");
ie.updateCollection();
}
catch (com.infoengine.SAK.IeServiceException iese)
{
}
Vector result =ie.getColumn("output", "obid");

Comparing with your code, it seems that you need to set the adapter.

Bjarne



Derek Botfield <derek.botfield@stryker.com>
14-08-2010 02:54
Please respond to
Derek Botfield <derek.botfield@stryker.com>


To
-
cc

Subject
[solutions] - ObjectWebject.invoke() exception






I am trying to invoke a webject, using SAK classes from a Java program.
Like so: com.infoengine.SAK.ObjectWebject ow = new
com.infoengine.SAK.ObjectWebject(); ow.setService(ieService);
ow.setUserName("xx"); ow.setPassword("xx"); ow.setName("Query-Objects");
ow.setParam("INSTANCE", "xx"); ow.addParam("DBUSER", "xx");
ow.addParam("PASSWD", "xx"); ow.setParam("TYPE",
"WCTYPE|wt.doc.WTDocument|com.abc.def"); ow.setParam("WHERE", "Name=*");
ow.setParam("ATTRIBUTE", "name, number,
Assy_or_Part_or_Fixture_Reference"); ow.setParam("GROUP_OUT", "RDocs");
ow.invoke(); This gives the following exception:
2010/08/13-20:40:42.338#:#INS002922#:#-IE-#:#java.lang.NullPointerException
at com.infoengine.procunit.adapter.Adapter.receive(Adapter.java:480) at
com.infoengine.procunit.webject.WebjectProcessor.routeWebject(WebjectProcessor.java:495)
at
com.infoengine.procunit.webject.WebjectProcessor.processTask(WebjectProcessor.java:106)
at com.infoengine.SAK.Webject.invoke(Webject.java:324) at
com.infoengine.SAK.ObjectWebject.invoke(ObjectWebject.java:96) at
com.infoengine.SAK.ObjectWebject.invoke(ObjectWebject.java:69) at
dab.TestWebjects.main(TestWebjects.java:60) I gather, from looking at the
code that Windchill is looking for an object input stream from which to
read BLOBS. I am guessing it has something to do with the webject being
invoked from an external program. Can anyone tell me how to fix this
problem? Thanks, Derek
Site Links: View post online View mailing list online Send new post
via email Unsubscribe from this mailling list Manage your subscription
Use of this email content is governed by the terms of service at: