Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » XWT runnable jar - does not find main.xwt in jar file
XWT runnable jar - does not find main.xwt in jar file [message #521902] Fri, 19 March 2010 08:53 Go to next message
A. Scheucher is currently offline A. ScheucherFriend
Messages: 9
Registered: March 2010
Junior Member
Hello!

We are evaluating with the org.eclipse.e4.xwt.emf.demo project from soyatec to get an first impression of the XWT technology. Everything is working fine, except the execution of a exported runnable jar file.

The generation of the jar file was done with included .jar files and also with .jar files in a lib subfolder with the same result:
java.net.MalformedURLException: Could not open InputStream for URL 'rsrc:demo\main.xwt'
        at org.eclipse.jdt.internal.jarinjarloader.RsrcURLConnection.getInputStream(RsrcURLConnection.java:46)
        at java.net.URL.openStream(URL.java:1009)
        at org.eclipse.e4.xwt.internal.xml.DocumentRoot.openStream(DocumentRoot.java:137)
        at org.eclipse.e4.xwt.internal.xml.ElementManager.load(ElementManager.java:221)
        at org.eclipse.e4.xwt.internal.core.Core.load(Core.java:642)
        at org.eclipse.e4.xwt.internal.core.Core.load(Core.java:633)
        at org.eclipse.e4.xwt.XWTLoader.loadWithOptions(XWTLoader.java:835)
        at org.eclipse.e4.xwt.XWTLoader$1.run(XWTLoader.java:768)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.xwt.XWTLoader.open(XWTLoader.java:762)
        at org.eclipse.e4.xwt.XWTLoader.open(XWTLoader.java:740)
        at org.eclipse.e4.xwt.XWT.open(XWT.java:434)
        at demo.Main.main(Main.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)


The main.xwt is in the jar file for sure under the folder /demo. So I do not know what's going wrong here.

Any ideas?

Thanks in advance and best regards,
Andreas
Re: XWT runnable jar - does not find main.xwt in jar file [message #525880 is a reply to message #521902] Thu, 08 April 2010 07:27 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
Hi,

Sorry for leaving out your post. I just check out the bundle and test it. It
works as expected. Please take care this example is not tested in jar. You
can start it in eclipse workspace via context menu "Run as"-> Java
applciation on Main.java

Regards
Yves YANG
"A. Scheucher" <andreas.scheucher@gmail.com> wrote in message
news:hnve26$11k$1@build.eclipse.org...
> Hello!
>
> We are evaluating with the org.eclipse.e4.xwt.emf.demo project from
> soyatec to get an first impression of the XWT technology. Everything is
> working fine, except the execution of a exported runnable jar file.
>
> The generation of the jar file was done with included .jar files and also
> with .jar files in a lib subfolder with the same result:
> java.net.MalformedURLException: Could not open InputStream for URL
> 'rsrc:demo\main.xwt'
> at
> org.eclipse.jdt.internal.jarinjarloader.RsrcURLConnection.ge tInputStream(RsrcURLConnection.java:46)
> at java.net.URL.openStream(URL.java:1009)
> at
> org.eclipse.e4.xwt.internal.xml.DocumentRoot.openStream(Docu mentRoot.java:137)
> at
> org.eclipse.e4.xwt.internal.xml.ElementManager.load(ElementM anager.java:221)
> at org.eclipse.e4.xwt.internal.core.Core.load(Core.java:642)
> at org.eclipse.e4.xwt.internal.core.Core.load(Core.java:633)
> at org.eclipse.e4.xwt.XWTLoader.loadWithOptions(XWTLoader.java: 835)
> at org.eclipse.e4.xwt.XWTLoader$1.run(XWTLoader.java:768)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at org.eclipse.e4.xwt.XWTLoader.open(XWTLoader.java:762)
> at org.eclipse.e4.xwt.XWTLoader.open(XWTLoader.java:740)
> at org.eclipse.e4.xwt.XWT.open(XWT.java:434)
> at demo.Main.main(Main.java:50)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(J arRsrcLoader.java:58)
>
> The main.xwt is in the jar file for sure under the folder /demo. So I do
> not know what's going wrong here.
>
> Any ideas?
>
> Thanks in advance and best regards,
> Andreas
>
Re: XWT runnable jar - does not find main.xwt in jar file [message #528635 is a reply to message #521902] Wed, 21 April 2010 10:45 Go to previous messageGo to next message
A. Scheucher is currently offline A. ScheucherFriend
Messages: 9
Registered: March 2010
Junior Member
Hi!

Thanks for your answer! I used the "Run as -> Java App" of courde to develop and test. Actually to play around a bit, not more.

But when it comes to deployment, this will not be sufficient Wink

After playing around a bit more with this problem, we realised an possible solution is to place the .xwt files outside the jar in the same direcotry structure and add the '.' folder to the classpath. Is this an issue of the XYZ.class.getResource(...) method in general? I thought it's possible to load resources inside a jar file with it! Maybe this was the underlying problem.

greets,
Andreas
Re: XWT runnable jar - does not find main.xwt in jar file [message #528829 is a reply to message #528635] Thu, 22 April 2010 01:57 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
"A. Scheucher" <andreas.scheucher@gmail.com> wrote in message
news:hqml0r$n1q$1@build.eclipse.org...
> Hi!
>
> Thanks for your answer! I used the "Run as -> Java App" of courde to
> develop and test. Actually to play around a bit, not more.
>
> But when it comes to deployment, this will not be sufficient ;)
>
> After playing around a bit more with this problem, we realised an possible
> solution is to place the .xwt files outside the jar in the same direcotry
> structure and add the '.' folder to the classpath. Is this an issue of the
> XYZ.class.getResource(...) method in general? I thought it's possible to
> load resources inside a jar file with it! Maybe this was the underlying
> problem.

Embedding the XWT resource in jars are static UI. You can generate it in
runtime, or load from anywhere.

Best regards
Yves YANG
>
> greets,
> Andreas
Previous Topic:XWT. Problem with Form background.
Next Topic:XWT runnable jar - does not find main.xwt in jar file
Goto Forum:
  


Current Time: Thu Apr 18 05:03:18 GMT 2024

Powered by FUDForum. Page generated in 0.02255 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top