[jira] Commented: (SM-804) Documentation for XPath Router is missing examples

2007-01-05 Thread Robert H. Pollack (JIRA)

[ 
https://issues.apache.org/activemq/browse/SM-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37819
 ] 

Robert H. Pollack commented on SM-804:
--

Wow! I couldn't ask for faster service than that! Thanks.



> Documentation for XPath Router is missing examples
> --
>
> Key: SM-804
> URL: https://issues.apache.org/activemq/browse/SM-804
> Project: ServiceMix
>  Issue Type: Bug
>Reporter: Robert H. Pollack
> Assigned To: Guillaume Nodet
>Priority: Trivial
> Fix For: 3.1
>
>
> The page that documents the XPath Router has blank areas where the examples 
> should be. See the page at http://www.servicemix.org/site/xpath-router.html, 
> which includes sentences such as "The following is an example routing and 
> transformation template," followed by a couple of blank lines.
> Based on a similar CodeHaus page 
> (http://servicemix.codehaus.org/XPath+Router), which also fails to show the 
> examples, but which displays error messages, I believe the problem is due to 
> bad server-side includes.
> The files which are intended to be included on the page seem to be the 
> following (all of which are distributed with the ServiceMix release):
> src/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/router-example.xml
> src/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/router.xsl
> src/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/split.xsl

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Created: (SM-804) Documentation for XPath Router is missing examples

2007-01-05 Thread Robert H. Pollack (JIRA)
Documentation for XPath Router is missing examples
--

 Key: SM-804
 URL: https://issues.apache.org/activemq/browse/SM-804
 Project: ServiceMix
  Issue Type: Bug
Reporter: Robert H. Pollack
Priority: Trivial


The page that documents the XPath Router has blank areas where the examples 
should be. See the page at http://www.servicemix.org/site/xpath-router.html, 
which includes sentences such as "The following is an example routing and 
transformation template," followed by a couple of blank lines.

Based on a similar CodeHaus page (http://servicemix.codehaus.org/XPath+Router), 
which also fails to show the examples, but which displays error messages, I 
believe the problem is due to bad server-side includes.

The files which are intended to be included on the page seem to be the 
following (all of which are distributed with the ServiceMix release):

src/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/router-example.xml
src/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/router.xsl
src/servicemix-components/src/test/resources/org/apache/servicemix/components/xslt/split.xsl

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (SM-553) MessageExchangeImpl.toString() converts message content to DOMSource

2006-11-08 Thread Robert H. Pollack (JIRA)
[ 
https://issues.apache.org/activemq/browse/SM-553?page=comments#action_37381 ] 

Robert H. Pollack commented on SM-553:
--


   [[ Old comment, sent by email on Wed, 23 Aug 2006 15:47:12 -0400 ]]

Dear M. Nodet,

Thanks for your quick attention to this problem.  I'm flattered that you
thought well enough of my change to keep my logic, even down to the name
of the flag.

I do have one minor quibble, though, that I'd like to call to your
attention.  Your change says

+if (preserveContent) {
+sb.append(getMessage(msg).getContent().getClass());
+} else {
+if (getMessage(msg).getContent() != null) {
+Node node =
st.toDOMNode(getMessage(msg).getContent());
...

I believe that the "if (preserveContent)" test should be AFTER the test
for null message content.  Otherwise, if getContent() returns null, you
will get a NullPointerException when you say "getContent().getClass()".

Thank you again for your quick service.

Bob Pollack
Gestalt, LLC



> MessageExchangeImpl.toString() converts message content to DOMSource
> 
>
> Key: SM-553
> URL: https://issues.apache.org/activemq/browse/SM-553
> Project: ServiceMix
>  Issue Type: Bug
>  Components: servicemix-core
>Affects Versions: 3.0-M2
>Reporter: Robert H. Pollack
> Assigned To: Guillaume Nodet
> Fix For: 3.0
>
> Attachments: patches.zip
>
>
> The toString() method of MessageExchangeImpl, in an attempt to show the in, 
> out, and fault messages of the exchange, converts their content to DOM.  If 
> this conversion succeeds, the user may be surprised, because the message has 
> changed from a stream source to a DOM source; this originally caused some 
> ClassCastExceptions in our code.
> If the conversion fails, the situation is even worse.  Now the message 
> content remains a stream source, but the stream has been consumed in the 
> attempted conversion, so the message is now empty.
> The reason that this toString method is getting called, almost no matter what 
> you do, is that ServiceMix is distributed with log levels set to DEBUG 
> (oddly, you don't see any debug messages, probably because the log4j.xml file 
> does not specify an appender for these messages).  This setting causes many 
> invocations of the form
> log.debug ("Now I'm doing something to " + myMessageExchange);
> which causes the toString method to be invoked whether or not anything is 
> actually printed.
> This toString method also turns out to have another problem.  If it does get 
> an exception, it returns null.  It turns out that an object's toString method 
> should never do this, because it can cause NullPointerExceptions if the 
> object is printed.
> I've created an alternate version of MessageExchangeImpl which corrects these 
> problems.  To use it, unzip the enclosed file into your SERVICEMIX_HOME 
> directory and run ant in the directory it creates.  This will create a new 
> class and insert it into a place that will cause ServiceMix 3.0 to use it in 
> preference to the original.  Be sure that you unzip this file into the right 
> place, though, because the ant script contains specific references to "..".
> A bit more detail is in the comments in the enclosed code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Created: (SM-570) HTTP connector can blow up while trying to report a problem

2006-09-08 Thread Robert H. Pollack (JIRA)
HTTP connector can blow up while trying to report a problem
---

 Key: SM-570
 URL: https://issues.apache.org/activemq/browse/SM-570
 Project: ServiceMix
  Issue Type: Bug
  Components: servicemix-components
Affects Versions: 3.0-M2
Reporter: Robert H. Pollack
Priority: Minor
 Attachments: HttpBindingSupport.java

The HttpBindingSupport class has a general exception reporter that handles 
uncaught exceptions by sending them back to the client as HTML messages.  The 
code looks like this:

PrintWriter writer = response.getWriter();
writer.println("Request failed with error: " + e);
e.printStackTrace(writer);

But the HttpMarshaler class, in preparing the normal response, has the 
following line:

getTransformer().toResult(message.getContent(), new 
StreamResult(response.getOutputStream()));

If this transformer fails, the error reporting logic will get an 
IllegalStateException, because you cannot ask for the response writer after you 
have already obtained the response output stream.  The solution is to ask for 
the output stream again (you are allowed to get it more than once) and created 
a new PrintWriter:  The following code seems to work just fine:

PrintWriter writer = null;
try {
writer = response.getWriter();
} catch (IllegalStateException ise) {
OutputStream os = response.getOutputStream();
writer = new PrintWriter (os);
}
writer.println("Request failed with error: " + e);
e.printStackTrace(writer);

A corrected version of the source file  (you also need another import 
statement) is attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Created: (SM-553) MessageExchangeImpl.toString() converts message content to DOMSource

2006-08-23 Thread Robert H. Pollack (JIRA)
MessageExchangeImpl.toString() converts message content to DOMSource


 Key: SM-553
 URL: https://issues.apache.org/activemq/browse/SM-553
 Project: ServiceMix
  Issue Type: Bug
  Components: servicemix-core
Affects Versions: 3.0-M2
Reporter: Robert H. Pollack
 Attachments: patches.zip

The toString() method of MessageExchangeImpl, in an attempt to show the in, 
out, and fault messages of the exchange, converts their content to DOM.  If 
this conversion succeeds, the user may be surprised, because the message has 
changed from a stream source to a DOM source; this originally caused some 
ClassCastExceptions in our code.

If the conversion fails, the situation is even worse.  Now the message content 
remains a stream source, but the stream has been consumed in the attempted 
conversion, so the message is now empty.

The reason that this toString method is getting called, almost no matter what 
you do, is that ServiceMix is distributed with log levels set to DEBUG (oddly, 
you don't see any debug messages, probably because the log4j.xml file does not 
specify an appender for these messages).  This setting causes many invocations 
of the form
log.debug ("Now I'm doing something to " + myMessageExchange);
which causes the toString method to be invoked whether or not anything is 
actually printed.

This toString method also turns out to have another problem.  If it does get an 
exception, it returns null.  It turns out that an object's toString method 
should never do this, because it can cause NullPointerExceptions if the object 
is printed.

I've created an alternate version of MessageExchangeImpl which corrects these 
problems.  To use it, unzip the enclosed file into your SERVICEMIX_HOME 
directory and run ant in the directory it creates.  This will create a new 
class and insert it into a place that will cause ServiceMix 3.0 to use it in 
preference to the original.  Be sure that you unzip this file into the right 
place, though, because the ant script contains specific references to "..".

A bit more detail is in the comments in the enclosed code.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira