You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
I'm trying to develop a web-service (based on jersey) which is converting a pdf document into jpeg images. I choosed GhostScript because I have good experiences with it and it's results (especially with embedet fonts). So I searched a way to use GhostScript with Java and found Ghost4j.
So I put all the Ghost4j jars into my applications lib folder (also the jna.jar). In my first tests I encountered a problem with executing the task more than once, because jna throws an error when it's launched more than one time. So I put the jna.jar into the tomcat lib folder. That worked a littlebit better, but it only executed one task at a time. If I started another one at the same time, nothing happened. I just didn't seem to execute the other task.
So I tried setMaxProcessCount(2); to allow my application to execute more than one task at a time.
But if I'm trying to execute my task, Ghost4j throws this error:
org.ghost4j.renderer.RendererException: java.lang.Exception: java.lang.NoClassDefFoundError: com/sun/jna/Structure
The text was updated successfully, but these errors were encountered:
The problem lies in the fact that for some reason : JNA jar is not on the classpath of the forked JVM.
As I don't know how your Tomcat JVM, I can only give you the part performing the fork in Ghost4J : it lies in JavaFork.java, the method is charge of retrieving the current classpath id called getCurrentClasspath, if you put some logs in it, you should be able to see where the problem lies.
If you find a fix, a pull request is always welcomed :)
How about appending the urls from System.getProperty("java.class.path") to the StringBuilder in getCurrentClasspath? In my case the urls in System.getProperty("java.class.path") are different from the urls you get with Thread.currentThread().getContextClassLoader().
Hello,
I tried to get help on Stackoverflow but it seems that nobody was able to solve my problem. So I'm asking my question here again.
See http://stackoverflow.com/questions/18441454/using-ghost4j-with-maxprocesscount-on-a-tomcat-causes-jna-error for details.
I'm trying to develop a web-service (based on jersey) which is converting a pdf document into jpeg images. I choosed GhostScript because I have good experiences with it and it's results (especially with embedet fonts). So I searched a way to use GhostScript with Java and found Ghost4j.
So I put all the Ghost4j jars into my applications lib folder (also the jna.jar). In my first tests I encountered a problem with executing the task more than once, because jna throws an error when it's launched more than one time. So I put the jna.jar into the tomcat lib folder. That worked a littlebit better, but it only executed one task at a time. If I started another one at the same time, nothing happened. I just didn't seem to execute the other task.
So I tried setMaxProcessCount(2); to allow my application to execute more than one task at a time.
But if I'm trying to execute my task, Ghost4j throws this error:
org.ghost4j.renderer.RendererException: java.lang.Exception: java.lang.NoClassDefFoundError: com/sun/jna/Structure
The text was updated successfully, but these errors were encountered: