Re: [net] NullPointerException from nntp.Threader.thread() when all messages in a derived thread are missing.

2014-04-02 Thread sebb
On 2 April 2014 21:55, Elliot Shank  wrote:
> Using v3.3, I'm getting problems like

Are you sure you are using 3.3?

> Exception in thread "main" java.lang.NullPointerException
> at
> org.apache.commons.net.nntp.Threader.gatherSubjects(Threader.java:342)
> at org.apache.commons.net.nntp.Threader.thread(Threader.java:81)
> at org.apache.commons.net.nntp.Threader.thread(Threader.java:47)

The above line numbers don't agree with the source for 3.3

> when a particular thread branch has no actual messages in it.
>
> What happens is that the graph returned by findRootSet() at line 71 will
> look something like
>
> ...
> 
> ...
> 
> 
> 
> 
> 
> 
> 
> 
> ...
> ...
>
> And, after pruneEmptyContainers() has had its way with things on line 75,
> the graph will be
>
> ...
> 
> ...
> 
> 
> ...
> ...
>
> when it should be
>
> ...
> 
> ...
> 
> ...
> ...
>
> I.e., ThreadContainer B should be eliminated entirely.
>
> As it is, with ThreadContainer B present, but not containing any children or
> a Threadable, gatherSubjects() chokes.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [net] NullPointerException from nntp.Threader.thread() when all messages in a derived thread are missing.

2014-04-02 Thread sebb
On 2 April 2014 21:55, Elliot Shank  wrote:
> Using v3.3, I'm getting problems like
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.apache.commons.net.nntp.Threader.gatherSubjects(Threader.java:342)
> at org.apache.commons.net.nntp.Threader.thread(Threader.java:81)
> at org.apache.commons.net.nntp.Threader.thread(Threader.java:47)
>
> when a particular thread branch has no actual messages in it.

Ideally this should please be reported as a JIRA issue.

> What happens is that the graph returned by findRootSet() at line 71 will
> look something like
>
> ...
> 
> ...
> 
> 
> 
> 
> 
> 
> 
> 
> ...
> ...
>
> And, after pruneEmptyContainers() has had its way with things on line 75,
> the graph will be
>
> ...
> 
> ...
> 
> 
> ...
> ...
>
> when it should be
>
> ...
> 
> ...
> 
> ...
> ...
>
> I.e., ThreadContainer B should be eliminated entirely.
>
> As it is, with ThreadContainer B present, but not containing any children or
> a Threadable, gatherSubjects() chokes.

Can you provide a sample news group that shows the problem?
For example using the example program:

examples.nntp.MessageThreading


> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[net] NullPointerException from nntp.Threader.thread() when all messages in a derived thread are missing.

2014-04-02 Thread Elliot Shank

Using v3.3, I'm getting problems like

Exception in thread "main" java.lang.NullPointerException
at org.apache.commons.net.nntp.Threader.gatherSubjects(Threader.java:342)
at org.apache.commons.net.nntp.Threader.thread(Threader.java:81)
at org.apache.commons.net.nntp.Threader.thread(Threader.java:47)

when a particular thread branch has no actual messages in it.

What happens is that the graph returned by findRootSet() at line 71 will look 
something like

...

...








...
...

And, after pruneEmptyContainers() has had its way with things on line 75, the 
graph will be

...

...


...
...

when it should be

...

...

...
...

I.e., ThreadContainer B should be eliminated entirely.

As it is, with ThreadContainer B present, but not containing any children or a 
Threadable, gatherSubjects() chokes.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [exec] Using Commons Exec for context-sensitive execution

2014-04-02 Thread Bernd Eckenfels
Hello,

did you try to write actual line endings?

I tested your code and it worked on Windows (cygwin bash) after adding
\n like:

os.write("export MY_VAR=test\n");
os.flush();
os.write("echo myvar:$MY_VAR\n");

Gruss
Bernd

I also think the use of the common-executor makes this whole stuff
unecesary complicated. Especially if the alternative is a Java7 with
ProcessBuilder and redirectOutput();


Am Wed, 2 Apr 2014 01:54:30 -0700 (PDT)
schrieb yalmasri :

> posting to fix the formatting on other mailing archives
> 
> 
> 
> --
> View this message in context:
> http://apache-commons.680414.n4.nabble.com/exec-Using-Commons-Exec-for-context-sensitive-execution-tp4661652p4661653.html
> Sent from the Commons - User mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



FileItem.fileName differnent with IE 11

2014-04-02 Thread oliver.pfau
Hi,



I made a proof of concept for the upload of multiple files with struts 1.

It work as expected with FF and chrome but not with IE 11. The FileItem path is 
differs.



With FF the FileItem.fileName is after upload for example  
"D:\fileuploadtemp\myfile.pdf"

which is correct.

If I do the same with IE 11, the FileItem.fileName is 
"C:\Users\my\Downloads\myfile.pdf"



Now when FileItem.write(...) is invoked like this:



File uploadedFile = new File(TEMP_DIR, fileName);

item.write(uploadedFile);



with IE 11 an exception is thrown because the resulting path is " 
D:\fileuploadtemp\C:\Users\my\Downloads\myfile.pdf".



This can be handled of course when instantiating the File object, but shouldn't 
it be same for the browsers?



Regards

Oliver



Re: [exec] Using Commons Exec for context-sensitive execution

2014-04-02 Thread yalmasri
posting to fix the formatting on other mailing archives



--
View this message in context: 
http://apache-commons.680414.n4.nabble.com/exec-Using-Commons-Exec-for-context-sensitive-execution-tp4661652p4661653.html
Sent from the Commons - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[exec] Using Commons Exec for context-sensitive execution

2014-04-02 Thread Yasser Al Masri
What I'm trying to do is simply run a batch file that does some 
preparatory work necessary for the subsequent commands to be executed 
successfully (setting environment variables and stuff). To prove this I 
put together a sample that uses Commons Exec


publicclassTester{publicstaticvoidmain(String[]args)throwsException{Testertester
 =newTester();MyResultHandlerhandler 
=tester.newMyResultHandler();CommandLinecommandLine 
=CommandLine.parse("bash");PipedOutputStreamps 
=newPipedOutputStream();PipedInputStreamis 
=newPipedInputStream(ps);BufferedWriteros 
=newBufferedWriter(newOutputStreamWriter(ps));Executorexecutor 
=newDefaultExecutor();PumpStreamHandlerioh 
=newPumpStreamHandler(System.out,System.err,is);executor.setStreamHandler(ioh);ioh.start();executor.execute(commandLine,handler);os.write("export
 MY_VAR=test");os.flush();os.write("echo 
$MY_VAR");os.flush();os.close();}privateclassMyResultHandlerextendsDefaultExecuteResultHandler{@OverridepublicvoidonProcessComplete(finalintexitValue){super.onProcessComplete(exitValue);System.out.println("\nsuccess");}@OverridepublicvoidonProcessFailed(finalExecuteExceptione){super.onProcessFailed(e);e.printStackTrace();}}}But
 that prints empty string instead of the word
 "test". Any clues?