Page 1 of 1

Using the libraries from a Firefox extension..HELP

PostPosted: Thu Aug 05, 2010 9:38 am
by tmnt
Hello,

So I'm trying to deploy my jar in a firefox xpi, using javascript and liveconnect to get to the java I wrote, which uses the pptx4j stuff. When i throw a simple main class in the jar and run it from console (or from eclipse, even without the main), everything works perfectly, but the second I try and access it from firefox land I keep getting reflect.invocationtargetexception errors from firefox. The internet all suggests that it is permissions based, but I am setting the securityManager/policy to null, so that really should be handled. In ant I included all the material from the jars I am referencing (docx4j and its dependencies).

I managed to attach a console to firefox to I could look at what log4j is telling me, and the last 4 lines are
JAXB: Using RI
JAXB: Using RI
something INFO: trying to load context, jcPML.context
something INFO: Context...loaded (context.java ln70)

where as when I run from console, everything works and those lines are followed by the construction of a partname for /_rels/_rels, then it relativises against the package and makes the part name for /ppt/slides/slide1.xml, etc.

I'm running fresh out of ideas here, so any help would be appreciated. I'm not exactly a pro at web stuff, but I managed to write some test files to my harddrive using the liveconnect, with security manager set to null, so I can't imagine that file permissions is actually the problem. I just thought I might be missing a subtle point to using pptx4j or something.

Thanks in advance,
Pablo

Re: Using the libraries from a Firefox extension..HELP

PostPosted: Thu Aug 05, 2010 7:49 pm
by jason
For some ideas, try googling: jaxb reflect.invocationtargetexception?

Can you find the underlying exception?

It may be a classloader issue. Like docx4j's, pptx4j's Context.java loads JAXBContexts specifying a class loader; you might need to look at this.

Hope this helps .. Jason

Re: Using the libraries from a Firefox extension..HELP

PostPosted: Tue Aug 10, 2010 7:41 am
by tmnt
Jason,

About to work on the classLoader issues, which means I have to build from source. This is my first time using maven and I'm getting some errors, but only on 4 dependencies (commons-vfs-patched-1.9.1.jar, jms, jmxri, jmxtools). I'm kind of stumped because everything on google says that if you cant find jms jmxri, etc, that just means you haven't included sun's super duper maven 2 repo, but I see in the pom.xml that you have included that repo.

I was trying to follow the building from source guide, but maven is not cooperating.

Thanks,
Pablo

----edit
apparently jms jmxri and jmxtools are required by license to be clickthrough, and the commons vfs one just magically got satisfied somehow when it wouldnt before. The eclipse still isnt showing no errors though. What eclipe plugin do you use? I downloaded Eclipse IAM.

Re: Using the libraries from a Firefox extension..HELP

PostPosted: Tue Aug 10, 2010 7:46 pm
by jason
I use m2eclipse - http://m2eclipse.sonatype.org/sites/m2e

What version of Java are you using? I only ask because of http://itknowledgeexchange.techtarget.c ... -problems/

Re: Using the libraries from a Firefox extension..HELP

PostPosted: Wed Aug 11, 2010 4:56 am
by tmnt
I am using version 20, but that link does make for an interesting read.

I finally got it to work, I had to force eclipse to use the jdk instead of the jre, because for some reason even setting jdk as the default didn't actually do it.

I'll let you know the results of the jaxb classloader stuff if I can get it working.