Comments (6)
I got same error in a likely setting.
Original comment by [email protected]
on 9 Apr 2011 at 12:41
from onejar-maven-plugin.
I am not using the maven plugin but just the Command Line approach document at
http://one-jar.sourceforge.net/index.php?page=getting-started&file=quickstart
and I also cannot load my log4j.xml from within the One Jar.
I get:
log4j:ERROR Could not parse url
[jar:file:/AppLink.jar!/main/StubMsgSvc.jar!/log4j.xml].
java.io.FileNotFoundException: \FOpenLink.jar (The system cannot find the file
specified) .....
Original comment by [email protected]
on 30 Sep 2011 at 6:27
from onejar-maven-plugin.
The only non-announcement post to this project's Google Group was about this
issue, too:
https://groups.google.com/group/onejar/browse_thread/thread/cfc13effd6bfb9ef
>>>>>
I have a maven build using one-jar to create an executable test JAR.
The JAR runs just fine, but during the execution of my main class I
need to load my TestNG xml from the root of the JAR, but this fails.
This mechanism works with an executable zip on another project. I
would prefer to use one-jar so that I don't have to manually manage
the dependencies.
I've confirmed that files exist in the myProject.jar and the paths
are:
/com/address/MyMain
/myFile.xml
I added the following to the MyMain class:
...
System.out.println("This is the path: " +
MyMain.class.getClassLoader().getResource("myFile.xml").toString());
ArrayList<String> suites = new ArrayList<String>();
String xmlPath =
MyMain.class.getClassLoader().getResource("myFile.xml").toString();
suites.add(xmlPath)
testng.setTestSuites(suites);
...
When I run the JAR I get this as an output:
This is the path: jar:file:/myProject.one-jar.jar!/main/
myProject.jar!/myFile.xml
java.io.FileNotFoundException: jar:file:/myProject.one-jar.jar!/
main/myProject.jar!/myFile.xml (No such file or directory)
I tried other paths but cannot find one that works.
Any idea how I can get the path for the xml file?
Original comment by [email protected]
on 2 Feb 2012 at 7:07
from onejar-maven-plugin.
You may have to use the One-Jar-Expand mechanism (documented at
http://one-jar.sourceforge.net) to expand the XML file into the filesystem
(somewhere), then load it from there as a File resource.
Best guess as to cause: something in testng is not using a URL which delegates
its handlers, hence it cannot understand the "jar" protocol.
Original comment by [email protected]
on 3 Feb 2012 at 5:19
from onejar-maven-plugin.
The root-cause of this issue is that Jar-URLs don't survive being converted to
a String and then back to a URL again. Somewhere there's a class that needs an
actual reference to the resource (Jar) and that reference is likely not
populated after being constructed back from a String again....
Original comment by [email protected]
on 20 Mar 2012 at 5:10
from onejar-maven-plugin.
Any direction on this? I'm getting the same issue and put the following into my
maven configuration. It put log4j.xml in the Manifest but I'm not getting any
different reaction.
<manifestEntries>
<One-Jar-Expand>log4j.xml</One-Jar-Expand>
</manifestEntries>
Original comment by eabrand
on 23 May 2012 at 7:54
from onejar-maven-plugin.
Related Issues (20)
- Artifacts should be copied by user selection (runtime, compile, etc) HOT 4
- Make OneJarMojo.mainJarFilename writeable HOT 2
- using different native libs for different os not working HOT 8
- Local dependency projects are not included in the onejar HOT 2
- upload to central repository HOT 2
- Provide override for generated jar file name HOT 1
- Support newer versions of OneJar HOT 3
- Axis2 jar doesnot load
- Use newer version of One-JAR 0.97 HOT 1
- Cant specify JarClassLoader for One-jar, need to because of spring url loading HOT 5
- Add arbitrary manifest entries to top-level
- generic classpath arguments cannot be passed to execution
- Patch for /trunk/src/site/apt/usage.apt
- Can this be used under Java 1.5?
- Enhanchment - support adding one-jar.properties to the target one-jar
- How to Get List of ClassPath Resources in OneJar? HOT 2
- Support system properties included as /one-jar.properties
- NullPointerException thrown trying to access MANIFEST.MF of embedded jars
- How to add class path folder in Manifest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onejar-maven-plugin.