Nov 20, 2012, 5:43 PM
21 Posts

lib folder ignored

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: jars WEB-INF java
  • Replies: 12
Hi,
 
i've created a lib folder in the WEB-INF folder to import external jar files into it and use them, as described in some articles on the net.
But if i try to use this libraries, i've always got an error.
 
importPackage(org.xyz......)
 
Error: HTTP JVM: 'org' not found
 
Any ideas?
 
Thanks Mario
Nov 21, 2012, 3:29 AM
135 Posts
Re: lib folder ignored
Hi,
 
from Designer menu choose: Project -> Properties -> Java Build Path -> Add JARs. I thought it would work also by Add Class Folder but I haven't gotten that to work.
 
- Panu 
Nov 21, 2012, 8:50 AM
21 Posts
Re: lib folder ignored
Thanks for your answer, but this doesn't help...
 
BR
Mario
Nov 21, 2012, 10:52 AM
135 Posts
Re: lib folder ignored
Possible problems / fixes:
 
- Check that the correct JAR is now listed in Java Build Path / Libraries 
- Make sure "Build  Automativally" is enabled
- Make sure you jar contains org.xyz..... as a public class
- Try Project -> Clean 
Nov 21, 2012, 11:18 AM
21 Posts
Re: lib folder ignored
nothing helps....
log:
21.11.2012 17:03:21   HTTP JVM: 'org' not found
 
the jar is listed in the class path.
 
here is the ssjs code:
 
    importPackage(org.apache.poi.hssf.usermodel);

    var con = facesContext.getExternalContext();
    var response:com.ibm.xsp.webapp.XspHttpServletResponse = con.getResponse();
    
    var writer = response.getWriter();

    var workbook:org.apache.poi.hssf.usermodel.HSSFWorkbook = new org.apache.poi.hssf.usermodel.HSSFWorkbook();
 
on the last line the error occurs.
 
BR
Mario
Nov 21, 2012, 11:47 AM
135 Posts
Re: lib folder ignored
That code works for me. I have the POI files in server jvm/ext folder because that are too big for NSF storage (=increase build time too much).
 
If you wish us to look at this further I guess you'll need to post screen shots of your WEB-INF folder and Java Build Path dialog.
 
- Panu 
 
 
Nov 21, 2012, 11:53 AM
21 Posts
Re: lib folder ignored
I wanted to post screenshots, but i did not find any button/link to upload files?!?!?
Nov 21, 2012, 12:04 PM
135 Posts
Re: lib folder ignored
 It would help a lot if they supported adding images here. You'll need to use http://tinypic.com/ or similar.
 
- Panu 
Nov 21, 2012, 12:09 PM
21 Posts
Re: lib folder ignored
after adding the jar to the buildpath, it desappears from the lib folder and appears under the referenced libaries node:
http://tinypic.com/r/2n8aa6f/6
 
here is the java build path dialog:
http://tinypic.com/r/35arvih/6
 
Thanks
Mario
Nov 21, 2012, 12:25 PM
135 Posts
Re: lib folder ignored
Looks OK to me. If you create a Code/Java element and and put your code there, does it build without errors?
 
Btw. I have 4 POI jars on disk: a couple of ooxmls and scratchpad. 
 
- Panu 
Nov 21, 2012, 12:57 PM
21 Posts
Re: lib folder ignored
uuuuuuaaaaaaahhhhhhhhhh
 
building and cleaning of the Code/Java code shows no problems.
 
BUT ssjs still not work.
 
I also put all 4 files now to the bild path, no change.
 
Mario
Nov 21, 2012, 2:22 PM
135 Posts
Re: lib folder ignored
 Very strange. As a workaround you could place your code in Code/Java and call that from SSJS which hopefully works.
Nov 21, 2012, 2:42 PM
21 Posts
Re: lib folder ignored
I thought also about this way.
I try it...
 
Thank you a lot!
MArio