java jar file - not able to fine java file when trying to create a service

  • fbadrud
  • 11/02/09
  • Offline
Posted: Fri, 12/04/2009 - 15:56

Hi:

 

I created a java class and exported it as a jar.  I then created an emml file to use the jar file.  I am able to run the emml file from eclipse fine (I added the jar file to the server classpath settings).

I need to create a service from this EMML file.  I pasted the jar file into

...\Presto2.7.0\server\apache-tomcat-5.5.20\webapps\presto\WEB-INF\lib

published the emmil file using studio.

 

From the service explorer I am able to view the service, when I click on it and try and make a mashlet using the service, it seems as if it is not able to find the jar file.

 

I receive the following error:

"Error execution Mashup Script : Error executing script : TypeError: [JavaPackage com.acn.financialforecasting.reader.MyTimeAndExpenseReader] is not a function, it is org.mozilla.javascript.NativeJavaPackage. (#4)

 

To me this basically means that it cannot find the jar file.  It seems like I am missing a step.  I know my code works fine as i was able to test it using studio, but here is the test code anyway:

 mashup name="MyTimeAndExpense2"

 

xmlns="http://www.jackbe.com/2008-03-01/EMMLSchema"

 

../xsd/EMMLSpec.xsd"

 

xsi:schemaLocation="http://www.jackbe.com/2008-03-01/EMMLSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<

<

output name="result" type="string"/>script type="text/javascript">

 

<![CDATA[

var item2 = new Packages.com.acn.financialforecasting.reader.MyTimeAndExpenseReader();

 

 

 

var boList = item2.getBOList();

var tempXMLString;

var xmlString = '';

for (var i = 0; i < 10; i++){

var temp = boList.get(i);

tempXMLString = Packages.com.jackbe.jbp.transform.DataTransformer.javaToXml(temp)

xmlString = tempXMLString;

}

 

 

result = Packages.com.jackbe.jbp.sas.nsd.NSDUtil.XMLToDOM(xmlString);

 

 

 

 

 

 

 

</

</

 

 

]]>script>mashup>

<

 

 

any help on how to incorporate jar files into services would be of great help...

 

thanks,

farzana 

 

 

cfff4
0
Your rating: None

Hi Farzana, Placing the jar

  • smithac
  • 10/28/09
  • Offline
  • Mon, 12/07/2009 - 09:19

Hi Farzana,

Placing the jar file in presto\WEB-INF\lib should work.

Can you please share the source code(java class), so that I can debug the problem.

Thanks,

Smitha

 

 


Hey Smitha:   I zipped up my

  • fbadrud
  • 11/02/09
  • Offline
  • Mon, 12/07/2009 - 14:23

Hey Smitha:

 

I zipped up my code and have attached.  THe main class is MyTimeAndExpenseReader.java.

Basically reads an excel sheet and returns a list of objects with populated values fromt he excel sheet.  Let me know if you need anything else.

FYI:

I think this is an environment issue, i hve presto 2.7 on my machine, i used a colleagues machine (presto 2.6.1) and my service was able to recognize the jar file

- Thanks,

Farzana

 


 Issue has been resolve, had

  • fbadrud
  • 11/02/09
  • Offline
  • Thu, 12/10/2009 - 00:39

 Issue has been resolve, had to do with the version of java i used to compile my code, it was not the same as what is being used by tomcat