Issues with Jar deployment

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Issues with Jar deployment

David McNelis

Morning,

 

I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.

 

However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.

 

I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 

 

Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?

 

Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.

Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?

 

Thanks for any thoughts.

 

David

Reply | Threaded
Open this post in threaded view
|

Re: Issues with Jar deployment

Todd Volkert

Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.


That's how I have my WTKX files organized in my fairly large-scale Pivot apps, and it works with JAR deployment.   How are you looking the paths up?  Make sure you're using classpath lookups and not absolute lookups.

-T
Reply | Threaded
Open this post in threaded view
|

Re: Issues with Jar deployment

Greg Brown
Administrator
In reply to this post by David McNelis
<base href="x-msg://61/">I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?


On May 27, 2010, at 11:16 AM, David McNelis wrote:

Morning,
 
I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.
 
However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.
 
I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 
 
Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?
 
Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.
Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?
 
Thanks for any thoughts.
 
David

Reply | Threaded
Open this post in threaded view
|

RE: Issues with Jar deployment

David McNelis
<base href="x-msg://61/">

The wtkx files are included in the exported jar file.

 

I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>

 

 

So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:

<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?

 

If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.

 

 

From: Greg Brown [mailto:[hidden email]]
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?

 

 

On May 27, 2010, at 11:16 AM, David McNelis wrote:



Morning,

 

I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.

 

However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.

 

I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 

 

Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?

 

Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.

Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?

 

Thanks for any thoughts.

 

David

 

Reply | Threaded
Open this post in threaded view
|

Re: Issues with Jar deployment

Greg Brown
Administrator
<base href="x-msg://61/">If the value of the src attribute begins with a slash, it is interpreted as an absolute path relative to the classpath. Otherwise, it is interpreted as relative to the including file.

What does the directory structure in your JAR look like? Based on your example, I would expect something like this:

/com/foo
  Main.class
  main.wtkx

/com/foo/foldername
  file.wtkx

Is that correct?


On May 27, 2010, at 12:53 PM, David McNelis wrote:

The wtkx files are included in the exported jar file.
 
I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>
 
 
So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:
<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?
 
If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.
 
 
From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment
 
I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?
 
 
On May 27, 2010, at 11:16 AM, David McNelis wrote:


Morning,
 
I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.
 
However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.
 
I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 
 
Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?
 
Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.
Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?
 
Thanks for any thoughts.
 
David
 

Reply | Threaded
Open this post in threaded view
|

RE: Issues with Jar deployment

David McNelis
<base href="x-msg://61/">

Can the same be said for when using readObject, where the / is the abosulte path relative to the classpath?

 

You are correct about the structure of the Jar.

 

From: Greg Brown [mailto:[hidden email]]
Sent: Thursday, May 27, 2010 12:23 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

If the value of the src attribute begins with a slash, it is interpreted as an absolute path relative to the classpath. Otherwise, it is interpreted as relative to the including file.

 

What does the directory structure in your JAR look like? Based on your example, I would expect something like this:

 

/com/foo

  Main.class

  main.wtkx

 

/com/foo/foldername

  file.wtkx

 

Is that correct?

 

 

On May 27, 2010, at 12:53 PM, David McNelis wrote:



The wtkx files are included in the exported jar file.

 

I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>

 

 

So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:

<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?

 

If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.

 

 

From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?

 

 

On May 27, 2010, at 11:16 AM, David McNelis wrote:




Morning,

 

I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.

 

However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.

 

I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 

 

Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?

 

Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.

Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?

 

Thanks for any thoughts.

 

David

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Issues with Jar deployment

Greg Brown
Administrator
<base href="x-msg://61/">Yes, but without the leading slash.

On May 27, 2010, at 2:19 PM, David McNelis wrote:

Can the same be said for when using readObject, where the / is the abosulte path relative to the classpath?
 
You are correct about the structure of the Jar.
 
From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 12:23 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment
 
If the value of the src attribute begins with a slash, it is interpreted as an absolute path relative to the classpath. Otherwise, it is interpreted as relative to the including file.
 
What does the directory structure in your JAR look like? Based on your example, I would expect something like this:
 
/com/foo
  Main.class
  main.wtkx
 
/com/foo/foldername
  file.wtkx
 
Is that correct?
 
 
On May 27, 2010, at 12:53 PM, David McNelis wrote:


The wtkx files are included in the exported jar file.
 
I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>
 
 
So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:
<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?
 
If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.
 
 
From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment
 
I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?
 
 
On May 27, 2010, at 11:16 AM, David McNelis wrote:



Morning,
 
I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.
 
However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.
 
I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 
 
Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?
 
Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.
Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?
 
Thanks for any thoughts.
 
David
 
 

Reply | Threaded
Open this post in threaded view
|

RE: Issues with Jar deployment

David McNelis
<base href="x-msg://61/">

I am golden now.  The preceeding slash in the include src fixed it for me.  Thanks a ton, guys!

 

From: Greg Brown [mailto:[hidden email]]
Sent: Thursday, May 27, 2010 1:27 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

Yes, but without the leading slash.

 

On May 27, 2010, at 2:19 PM, David McNelis wrote:



Can the same be said for when using readObject, where the / is the abosulte path relative to the classpath?

 

You are correct about the structure of the Jar.

 

From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 12:23 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

If the value of the src attribute begins with a slash, it is interpreted as an absolute path relative to the classpath. Otherwise, it is interpreted as relative to the including file.

 

What does the directory structure in your JAR look like? Based on your example, I would expect something like this:

 

/com/foo

  Main.class

  main.wtkx

 

/com/foo/foldername

  file.wtkx

 

Is that correct?

 

 

On May 27, 2010, at 12:53 PM, David McNelis wrote:




The wtkx files are included in the exported jar file.

 

I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>

 

 

So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:

<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?

 

If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.

 

 

From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?

 

 

On May 27, 2010, at 11:16 AM, David McNelis wrote:





Morning,

 

I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.

 

However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.

 

I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 

 

Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?

 

Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.

Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?

 

Thanks for any thoughts.

 

David

 

 

 

Reply | Threaded
Open this post in threaded view
|

RE: Issues with Jar deployment

David McNelis
<base href="x-msg://61/">

And…now there is a new issue…though this is just more of a headache than anything…

 

The deployment is working fine, however, now the include directives are trying to point to the ‘bin’ folder in my pivot project, and it doesn’t move the wtkx files over there because javac presumably wouldn’t pick them up.  (This is when I try to run the application from inside Eclipse, i.o.w., clicking the pretty little green “play” button).

 

I realize this is likely more of an IDE question than a straight Pivot question, but I figure someone has probably already been down this path and might have a solution.

 

Or maybe I’m not making sense at the moment, in which case I’ll try to rephrase it later.

 

From: David McNelis [mailto:[hidden email]]
Sent: Thursday, May 27, 2010 1:29 PM
To: [hidden email]
Subject: RE: Issues with Jar deployment

 

I am golden now.  The preceeding slash in the include src fixed it for me.  Thanks a ton, guys!

 

From: Greg Brown [mailto:[hidden email]]
Sent: Thursday, May 27, 2010 1:27 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

Yes, but without the leading slash.

 

On May 27, 2010, at 2:19 PM, David McNelis wrote:

 

Can the same be said for when using readObject, where the / is the abosulte path relative to the classpath?

 

You are correct about the structure of the Jar.

 

From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 12:23 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

If the value of the src attribute begins with a slash, it is interpreted as an absolute path relative to the classpath. Otherwise, it is interpreted as relative to the including file.

 

What does the directory structure in your JAR look like? Based on your example, I would expect something like this:

 

/com/foo

  Main.class

  main.wtkx

 

/com/foo/foldername

  file.wtkx

 

Is that correct?

 

 

On May 27, 2010, at 12:53 PM, David McNelis wrote:



The wtkx files are included in the exported jar file.

 

I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>

 

 

So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:

<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?

 

If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.

 

 

From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment

 

I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?

 

 

On May 27, 2010, at 11:16 AM, David McNelis wrote:




Morning,

 

I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.

 

However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.

 

I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 

 

Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?

 

Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.

Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?

 

Thanks for any thoughts.

 

David

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Issues with Jar deployment

Greg Brown
Administrator
<base href="x-msg://61/">Not sure what the problem might be there. I generally use Eclipse to build and debug, but I use Ant to package up an application for deployment. My build script includes everything except for *.java files from the src directory so the *.wtkx, *.json, etc. files are all included in the JAR.


On May 27, 2010, at 2:38 PM, David McNelis wrote:

And…now there is a new issue…though this is just more of a headache than anything…
 
The deployment is working fine, however, now the include directives are trying to point to the ‘bin’ folder in my pivot project, and it doesn’t move the wtkx files over there because javac presumably wouldn’t pick them up.  (This is when I try to run the application from inside Eclipse, i.o.w., clicking the pretty little green “play” button).
 
I realize this is likely more of an IDE question than a straight Pivot question, but I figure someone has probably already been down this path and might have a solution.
 
Or maybe I’m not making sense at the moment, in which case I’ll try to rephrase it later.
 
From: David McNelis [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 1:29 PM
To: [hidden email]
Subject: RE: Issues with Jar deployment
 
I am golden now.  The preceeding slash in the include src fixed it for me.  Thanks a ton, guys!
 
From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 1:27 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment
 
Yes, but without the leading slash.
 
On May 27, 2010, at 2:19 PM, David McNelis wrote:

 

Can the same be said for when using readObject, where the / is the abosulte path relative to the classpath?
 
You are correct about the structure of the Jar.
 
From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 12:23 PM
To: [hidden email]
Subject: Re: Issues with Jar deployment
 
If the value of the src attribute begins with a slash, it is interpreted as an absolute path relative to the classpath. Otherwise, it is interpreted as relative to the including file.
 
What does the directory structure in your JAR look like? Based on your example, I would expect something like this:
 
/com/foo
  Main.class
  main.wtkx
 
/com/foo/foldername
  file.wtkx
 
Is that correct?
 
 
On May 27, 2010, at 12:53 PM, David McNelis wrote:



The wtkx files are included in the exported jar file.
 
I think that part of the root problem might have to do with my includes.  In my main wtkx file I am using the following include… <wtkx:include src="foldername/file.wtkx"></wtkx:include>
 
 
So its getting the main class’s wtkx file at this point, but when it goes to pull in the next component, which exists in the jar file…  should I be referring to the include as:
<wtkx:include src=”org/me/package/whatever/file.wtkx”?  Or is there something similar to Class#getResource() that can be added in to help it find the correct file?
 
If I have the jarfile and the ‘foldername/wtkx’ residing in the same folder, all works well.  But I don’t want to have to make second copies of all the wtkx files since they are already in te jar file.
 
 
From: Greg Brown [mailto:[hidden email]] 
Sent: Thursday, May 27, 2010 10:34 AM
To: [hidden email]
Subject: Re: Issues with Jar deployment
 
I haven't used the "export" feature in Eclipse. What does it actually produce? Does it build a JAR? Maybe you need to tell Eclipse to include *.wtkx files in the resulting JAR?
 
 
On May 27, 2010, at 11:16 AM, David McNelis wrote:




Morning,
 
I have a moderately complex Pivot based app that for the time being is running as a standalone desktop application.  When I run from within eclipse, everything works just fine.
 
However, when I try to export my project I consistently get a null resource saying that it can’t located the wtkx files.
 
I’ve tried changing the file locations to a static full path, i.e. C:/project/filename.wtkx and placed the files in that path, but it still claims to not be able to find the resources. 
 
Has anyone else had difficulties building out an application like this?  Are certain things I need to be doing in my directory structure to make sure that everything  works correctly?
 
Currently I have wtkx files living in the same folders as the classes that reference them directly, i.e.
Org.me.project.pkg.class.MyClass has both the java and wtkx file in org/me/project/class/  That seemed, at least at the time, to be the simplest organizational pattern..but I guess it is flawed?
 
Thanks for any thoughts.
 
David