You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Steven E. Harris" <se...@panix.com> on 2007/03/03 19:06:07 UTC

Problem with maven-ipojo-plugin -- Manipulator.preProcess()

All of this was working just fine on my computer at work, but I'm
seeing a strange failure in the iPOJO Maven plugin on my home
computer.

Whenever I run "mvn package", an exception gets thrown near the end of

  org.apache.felix.ipojo.manipulation.Manupulator.preProcess()

in the code section here:

,----
| File file = null;
| try {
|     file = new File(url.getFile());
| 
|     //file.createNewFile();
|     FileOutputStream fos = new FileOutputStream(file);
|                 
|     fos.write(cw0.toByteArray());
|                 
|     fos.close();
|     IPojoPluginConfiguration.getLogger().log(Level.INFO, "Put the file " + file.getAbsolutePath() + " in the jar file");
| } catch (Exception e) { System.err.println("Problem to write the adapted class on the file system " + " [ "+ file.getAbsolutePath() +" ] " + e.getMessage()); }
`----

My guess is that the exception is FileNotFoundException, thrown from
the FileOutputStream constructor. I can't run this code in my
debugger, so I'm guessing about that.

The output of "e.getMessage()" logged to the console is:

  The system cannot find the path specified

Now, the class file in question is there on my disk at the path
indicated, and it's both readable and writable by me. Any idea what
could be going on here?

-- 
Steven E. Harris

Re: Problem with maven-ipojo-plugin -- Manipulator.preProcess()

Posted by "Steven E. Harris" <se...@panix.com>.
"Richard S. Hall" <he...@ungoverned.org> writes:

> Best best is to attach patches to a JIRA issue and check the "grant"
> checkbox.

Per your suggestion, I just created JIRA issue FELIX-221:

  https://issues.apache.org/jira/browse/FELIX-221

-- 
Steven E. Harris

Re: Problem with maven-ipojo-plugin -- Manipulator.preProcess()

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Best best is to attach patches to a JIRA issue and check the "grant" 
checkbox.

-> richard

Steven E. Harris wrote:
> [I forgot that this mailing list does strange thing with messages with
>  attachments. The body text that went along with the patch message was
>  as follows:]
>
> "Steven E. Harris" <se...@panix.com> writes:
>
>   
>> Perhaps rather than calling "new File(url.getFile())" on line 114 in
>> Manipulator.java, we should reuse the String "path" created on line
>> 75, or the File wrapped around it on line 76, as these paths
>> apparently contain the non-URL-munged syntax.
>>     
>
> Attached please find a patch taking the second option -- reusing the
> File instance "clazz".
>
>   

Re: Problem with maven-ipojo-plugin -- Manipulator.preProcess()

Posted by "Steven E. Harris" <se...@panix.com>.
[I forgot that this mailing list does strange thing with messages with
 attachments. The body text that went along with the patch message was
 as follows:]

"Steven E. Harris" <se...@panix.com> writes:

> Perhaps rather than calling "new File(url.getFile())" on line 114 in
> Manipulator.java, we should reuse the String "path" created on line
> 75, or the File wrapped around it on line 76, as these paths
> apparently contain the non-URL-munged syntax.

Attached please find a patch taking the second option -- reusing the
File instance "clazz".

-- 
Steven E. Harris

Re: Problem with maven-ipojo-plugin -- Manipulator.preProcess()

Posted by "Steven E. Harris" <se...@panix.com>.
"Steven E. Harris" <se...@panix.com> writes:

> I set Windows back to use "Simple File Sharing" -- something I had
> been toying with yesterday -- and now it works.

Actually, no it doesn't. The problem is spaces in path names. I ran
Sysinternals Process Monitor to catch the problematic file access
operations. iPOJO is using URL syntax as a file name, with spaces
replaced by "%20" and such. Windows fails to allow such a file to be
created if, say, it can't find

  C:\Documents%20and%20Settings\...

On my computer at work, my "My Documents" directory is actually the
root of a mapped drive, so there are no spaces in the path names.

Perhaps rather than calling "new File(url.getFile())" on line 114 in
Manipulator.java, we should reuse the String "path" created on line
75, or the File wrapped around it on line 76, as these paths
apparently contain the non-URL-munged syntax.

-- 
Steven E. Harris

Re: Problem with maven-ipojo-plugin -- Manipulator.preProcess()

Posted by "Steven E. Harris" <se...@panix.com>.
"Steven E. Harris" <se...@panix.com> writes:

> Any idea what could be going on here?

I set Windows back to use "Simple File Sharing" -- something I had
been toying with yesterday -- and now it works. Apparently there's
some permissions-related subtlety that arises when changing the file
sharing mode.

For the record, the project lives in a directory under "My Documents",
which gets some special treatment with respect to file sharing. I'll
save that investigation for some other day.

-- 
Steven E. Harris