You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by David McNelis <Dm...@sharedmarketing.com> on 2010/05/27 17:16:35 UTC

Issues with Jar deployment

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


Re: Issues with Jar deployment

Posted by Greg Brown <gk...@mac.com>.
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:Dmcnelis@sharedmarketing.com] 
> Sent: Thursday, May 27, 2010 1:29 PM
> To: user@pivot.apache.org
> 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:gkbrown@mac.com] 
> Sent: Thursday, May 27, 2010 1:27 PM
> To: user@pivot.apache.org
> 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:gkbrown@mac.com] 
> Sent: Thursday, May 27, 2010 12:23 PM
> To: user@pivot.apache.org
> 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:gkbrown@mac.com] 
> Sent: Thursday, May 27, 2010 10:34 AM
> To: user@pivot.apache.org
> 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
>  
>  
>  


RE: Issues with Jar deployment

Posted by David McNelis <Dm...@sharedmarketing.com>.
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:Dmcnelis@sharedmarketing.com] 
Sent: Thursday, May 27, 2010 1:29 PM
To: user@pivot.apache.org
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 1:27 PM
To: user@pivot.apache.org
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 12:23 PM
To: user@pivot.apache.org
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 10:34 AM
To: user@pivot.apache.org
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

 

 

 


RE: Issues with Jar deployment

Posted by David McNelis <Dm...@sharedmarketing.com>.
I am golden now.  The preceeding slash in the include src fixed it for
me.  Thanks a ton, guys!

 

From: Greg Brown [mailto:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 1:27 PM
To: user@pivot.apache.org
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 12:23 PM
To: user@pivot.apache.org
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 10:34 AM
To: user@pivot.apache.org
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

 

 

 


Re: Issues with Jar deployment

Posted by Greg Brown <gk...@mac.com>.
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:gkbrown@mac.com] 
> Sent: Thursday, May 27, 2010 12:23 PM
> To: user@pivot.apache.org
> 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:gkbrown@mac.com] 
> Sent: Thursday, May 27, 2010 10:34 AM
> To: user@pivot.apache.org
> 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
>  
>  


RE: Issues with Jar deployment

Posted by David McNelis <Dm...@sharedmarketing.com>.
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 12:23 PM
To: user@pivot.apache.org
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 10:34 AM
To: user@pivot.apache.org
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

 

 


Re: Issues with Jar deployment

Posted by Greg Brown <gk...@mac.com>.
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:gkbrown@mac.com] 
> Sent: Thursday, May 27, 2010 10:34 AM
> To: user@pivot.apache.org
> 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
>  


RE: Issues with Jar deployment

Posted by David McNelis <Dm...@sharedmarketing.com>.
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:gkbrown@mac.com] 
Sent: Thursday, May 27, 2010 10:34 AM
To: user@pivot.apache.org
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

 


Re: Issues with Jar deployment

Posted by Greg Brown <gk...@mac.com>.
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


Re: Issues with Jar deployment

Posted by Todd Volkert <tv...@gmail.com>.
> 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