I would like to import 2 jar files “comm.jar” and “smslib-2.1.3.jar” to my java service… but these files are not in the classpath it seems… i was getting error -" package javax.comm does not exist import javax.comm.CommPort;"
^
please let me know the path where these jars are to be placed…
If you want the jar file to be specific for a single package then place the Jar file in following location. change the package name to your specific package.
In package A, jar J is in packages/A/code/jars
Package B has dependency on package A
Java code in package B can use classes from J.
… but whenever I try this, B throws InvocationTargetException.
I also tried putting the jar in packages/A/code/jars/static - with no luck.
I gave up and put all the jars in $IS_DIR/lib/jars - which has the highly undesirable consequence that we have to restart IS whenever the jar is updated.
Jars stored within a package directory cannot be used directly by other packages.
The dependency feature of IS controls the order of package loading only and nothing else.
You could place a jar file within a specific package and then create services to access the functionality from other packages. For example, if there is a foo method in the jar, write a foo service that uses that method within the package (package A). Then services in another package (package B) can call that foo service. In this case, configure package B to be dependent on package A so that A is loaded before B and whenever A is reloaded, B will be reloaded.
Thanks for the reference. I’ve never been able to make the cross-package JAR file work either. But I’m going to investigate further based on that read me entry. I’ve been wrong before and perhaps I’m wrong on this issue!