Closed GoogleCodeExporter closed 9 years ago
Hi!
Thank you for taking time to submit this issue.
I have never used Java Help before, and having downloaded it now and looking at
their
samples, I can't get them to run easily with Maven.
Could you please put together a minimal Maven project using Java Help, which
triggers
the problem you are describing? It needs to /work/ /without/
onejar-maven-plugin, and
to /not/ work /with/ onejar-maven-plugin. That would help very much in
debugging this
issue.
Please submit it in the simplest way you know, for example on github.com, or
zipping
it up and attaching to this issue, or simple copy/pasting every file's contents
directly in a comment here.
Thank you in advance!
/Hugo
Original comment by hugo.josefson.old@gmail.com
on 12 Jun 2009 at 5:41
Original comment by hugo.josefson.old@gmail.com
on 12 Jun 2009 at 6:58
Hi, I also had this problem but using Hibernate's EntityManager implementation.
The
problem occurs when Hibernate is trying to scan a jar for entities.
java.lang.ClassCastException: sun.misc.Launcher$AppClassLoader cannot be cast
to
com.simontuffs.onejar.JarClassLoader
at
com.simontuffs.onejar.JarClassLoader.getByteStream(JarClassLoader.java:753)
at com.simontuffs.onejar.Handler$1.getInputStream(Handler.java:50)
at java.net.URL.openStream(Unknown Source)
at
org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputS
tream
ZippedJarVisitor.java:37)
at
org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVis
itor.
java:139)
at
org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287
)
at
org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.jav
a:282
)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:247)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersi
stenc
e.java:125)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
I actually made a change to the JarClassLoader in the OneJar project itself to
get
round this problem.
if (result == null && delegateToParent)
{
ClassLoader parentClassLoader = getParent();
// JarClassLoader cannot satisfy requests for actual jar
files themselves so it must delegate to it's
// parent. However, the "parent" is not always a
JarClassLoader.
if (parentClassLoader instanceof JarClassLoader)
result = ((JarClassLoader)
parentClassLoader).getByteStream(resource);
else
result =
parentClassLoader.getResourceAsStream(resource);
}
I'm not sure where (or how) to submit this patch but it works for us.
James.
Original comment by bruce.n...@gmail.com
on 16 Nov 2009 at 2:24
Hi James,
They host the One-JAR project at SourceForge. Here is the project's Tracker
page:
http://sourceforge.net/tracker/?group_id=111153
You should probably file it in the "Patches" tracker. I'm sure they will
appreciate
your patch.
Thanks,
Hugo
Original comment by hugo.josefson.old@gmail.com
on 16 Nov 2009 at 6:18
It appears somebody has already submitted a patch but that was 2 years ago!
http://sourceforge.net/tracker/?func=detail&aid=1805547&group_id=111153&atid=658
459
I had assumed the project was now hosted here hence posting but I guess that is
not the
case. Shame because it's a useful packaging option.
Original comment by bruce.n...@gmail.com
on 17 Nov 2009 at 10:05
Huh. No, we're not that good at classpath hacking :) We just do the Maven
plugin,
which collects the One-JAR together with your jars and your dependencies.
You could try contacting Simon Tuffs directly, to figure out the status and let
him
know about the patches. Maybe he has just been really busy lately..?
Thanks,
Hugo
Original comment by hugo.josefson.old@gmail.com
on 17 Nov 2009 at 7:52
Marking this issue as WontFix, because it seems we can't fix it here in the
plugin.
It's a classpath thing within the upstream One-JAR project itself.
Original comment by hugo.josefson.old@gmail.com
on 17 Nov 2009 at 7:53
Hmmm... Ok, so if I fix one-jar, how can I get the plugin to use the fixed
version?
Original comment by obast...@gmail.com
on 17 Dec 2009 at 6:53
Hi All:
As you say, I've been really busy recently, but your activity in building this
maven
plugin has given urgency to rolling out a new version of One-JAR, incorporating
various patches and fixes that have been submitted.
Thanks for producing this useful maven plugin, I'll try to make sure One-JAR is
up-
to-date.
Simon.
Original comment by simontu...@gmail.com
on 18 Dec 2009 at 5:21
Hi Simon,
Thanks for commenting.
I gave you committer permissions on this project, so that you can (if you want
to)
tag and change status on issues here too. For example when you see issues here
which
are actually in the scope of the One-JAR project, you might want to set their
status
here on the Maven plugin as WontFix, and add a comment about how/where they can
work
with you to get it fixed upstream.
Again, thanks for staying involved! There's quite a bunch of us who enjoy and
rely on
your great One-JAR project :)
Happy new year!
/Hugo
Original comment by hugo.josefson.old@gmail.com
on 31 Dec 2009 at 1:04
This should be fixed in OneJAR 0.97, which is included in onejar-maven-plugin
1.4.3.
Please try <version>1.4.3</version> for the onejar-maven-plugin in your pom.
Thanks,
Hugo
Original comment by hugo.josefson.old@gmail.com
on 31 May 2010 at 6:59
Original issue reported on code.google.com by
hazlorea...@gmail.com
on 10 Jun 2009 at 3:05