You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by "Le Zhou (周乐)" <le...@gmail.com> on 2010/12/22 07:35:44 UTC

"Could not find resource" problem in "Hello WTKX"

Hi everyone,

I'm a newbie of pivot, when i tried the "Hello, WTKX!" problem in tutorial,
I run into "Could not find resource" problem.

I just replacd the "hello.wtkx" in source code of the "Hello, WTKX!" program
in tutorial with "/home/lezhou/hello.wtkx", which is the absolute path of
the WTKX source file on my computer and the the problem occured. I'm so
confused....

Detailed error message are shown below:
java.lang.IllegalArgumentException: Could not find resource
"/home/lezhou/hello.wtkx" for class "hellowtkx.HelloWTKX".

Anyone can help me? Thanks a lot!

Re:

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
wtkx (or bxml form Pivot-2.0) should be in a folder (or subfolder) in the
classpath.

If you use Eclipse pay attention to NOT have filters enabled in sources
folders (something like "use only *.java") because otherwise they will not
be copied during compilation in the related folder under bin.

Or if you prefer a Maven-like project structure, you could put them in a
dedicated resources folder (adding it as a source folder in the eclipse
project), for example src/main/resources (where any content is copied by
Eclipse builds in bin) and if you want enable sources filtering in
src/main/java folders (or similar) ...

Bye,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Could-not-find-resource-problem-in-Hello-WTKX-tp2129922p2137414.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: "Could not find resource" problem in "Hello WTKX"

Posted by Le Zhou <le...@gmail.com>.
I'm using eclipse, i put the WTKX file under the "bin" directory and it
works!

Thank João Neves very much!

2010/12/22 João Neves <se...@gmail.com>

> Hi Le,
>
> Make sure you have your WTKX file on the application's classpath and
> reference it only by the file name (hello.wtkx).
>
> If you're using an IDE like Eclipse, all you have to do is put the
> WTKX file on the same package as your .java source files and it will
> work.
>
> Cheers!
>
> --
> João Neves
>
>
>
> On Wed, Dec 22, 2010 at 06:35, Le Zhou(周乐) <le...@gmail.com> wrote:
> > Hi everyone,
> > I'm a newbie of pivot, when i tried the "Hello, WTKX!" problem in
> tutorial,
> > I run into "Could not find resource" problem.
> > I just replacd the "hello.wtkx" in source code of the "Hello, WTKX!"
> program
> > in tutorial with "/home/lezhou/hello.wtkx", which is the absolute path of
> > the WTKX source file on my computer and the the problem occured. I'm so
> > confused....
> > Detailed error message are shown below:
> > java.lang.IllegalArgumentException: Could not find resource
> > "/home/lezhou/hello.wtkx" for class "hellowtkx.HelloWTKX".
> > Anyone can help me? Thanks a lot!
> >
> >
> >
>

Re: "Could not find resource" problem in "Hello WTKX"

Posted by João Neves <se...@gmail.com>.
Hi Le,

Make sure you have your WTKX file on the application's classpath and
reference it only by the file name (hello.wtkx).

If you're using an IDE like Eclipse, all you have to do is put the
WTKX file on the same package as your .java source files and it will
work.

Cheers!

--
João Neves



On Wed, Dec 22, 2010 at 06:35, Le Zhou(周乐) <le...@gmail.com> wrote:
> Hi everyone,
> I'm a newbie of pivot, when i tried the "Hello, WTKX!" problem in tutorial,
> I run into "Could not find resource" problem.
> I just replacd the "hello.wtkx" in source code of the "Hello, WTKX!" program
> in tutorial with "/home/lezhou/hello.wtkx", which is the absolute path of
> the WTKX source file on my computer and the the problem occured. I'm so
> confused....
> Detailed error message are shown below:
> java.lang.IllegalArgumentException: Could not find resource
> "/home/lezhou/hello.wtkx" for class "hellowtkx.HelloWTKX".
> Anyone can help me? Thanks a lot!
>
>
>