[Resin-interest] replace XMLOutputFactory implementation class in resin 3.1.8

2009-07-22 Thread Huitang Li
Hi,

I need to replace the com.caucho.xml.stream.XMLOutputFactoryImpl with woodstox 
stax implementation version, since it seems that the 
com.caucho.xml.stream.XMLStreamWriterImpl class created from 
com.caucho.xml.stream.XMLOutputFactoryImpl has bugs in it and cannot build good 
xml (I notice that one namespace in the expected xml is not defined). 

Is there a way to do such replacement in resin 3.1.8? 

I tried to put 

 system-property 
javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory/
   system-property 
javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory/
   system-property 
javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory/

in resin.conf.

It did not work. Somehow the EnvironmentClassLoader for the web app still grabs 
the resin implementation of stax.

Please help.


Thanks.


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information.  Any unauthorized 
review, use, disclosure or distribution is prohibited. Nothing contained in 
this message or in any attachment shall constitute a contract or electronic 
signature under the Electronic Signatures in Global and National Commerce Act, 
any version of the Uniform Electronic Transactions Act or any other statute 
governing electronic transactions.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] replace XMLOutputFactory implementation class in resin 3.1.8

2009-07-22 Thread Huitang Li
Those parameters are set on the command line when starting resin, and it works.

I downloaded resin 4.0.0 and found that trying to configure system properties 
in resin.xml still does not work. Maybe it is a deprecated feature already in 
resin to configure system properties with system-property element?

Thanks.



NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information.  Any unauthorized 
review, use, disclosure or distribution is prohibited. Nothing contained in 
this message or in any attachment shall constitute a contract or electronic 
signature under the Electronic Signatures in Global and National Commerce Act, 
any version of the Uniform Electronic Transactions Act or any other statute 
governing electronic transactions.

- Original Message -
From: Huitang Li h...@kpi-consulting.net
To: resin-interest@caucho.com
Sent: Wednesday, July 22, 2009 1:27:44 PM GMT -06:00 US/Canada Central
Subject: [Resin-interest] replace XMLOutputFactory implementation class in 
resin 3.1.8

Hi,

I need to replace the com.caucho.xml.stream.XMLOutputFactoryImpl with woodstox 
stax implementation version, since it seems that the 
com.caucho.xml.stream.XMLStreamWriterImpl class created from 
com.caucho.xml.stream.XMLOutputFactoryImpl has bugs in it and cannot build good 
xml (I notice that one namespace in the expected xml is not defined). 

Is there a way to do such replacement in resin 3.1.8? 

I tried to put 

 system-property 
javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory/
   system-property 
javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory/
   system-property 
javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory/

in resin.conf.

It did not work. Somehow the EnvironmentClassLoader for the web app still grabs 
the resin implementation of stax.

Please help.


Thanks.


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information.  Any unauthorized 
review, use, disclosure or distribution is prohibited. Nothing contained in 
this message or in any attachment shall constitute a contract or electronic 
signature under the Electronic Signatures in Global and National Commerce Act, 
any version of the Uniform Electronic Transactions Act or any other statute 
governing electronic transactions.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] More on include()/forward() issue.

2008-03-07 Thread Huitang Li
Here is not a solution, while it gives some insights on java sevelet 
spec and jsp spec:

http://today.java.net/pub/a/today/2005/08/04/jspcomponents.html?page=3#jsp_servlets_compatibility

In this article, it referred to old resin versions, I believe. Probably 
this can be  helpful for resin developers to consider the issue and help 
resolve the already committed or illegal state exceptions.

By the way, for the issue in the post [Resin-interest] Resin 3.1, 
RequestDispatcher, include() and forward(),  I do not know how struts 
1.3.8 is configured on your machine and your application code. However, 
the illegal state exception did disappear when we upgraded to struts 
1.3.8 in the web app with resin 3.1.4. The code causing that exception 
previously is:

jsp:include page=/blah/blah/strutsAction.do/


Hope this helps.




Ilya Kasnacheev wrote:
 В сообщении от 7 Март 2008 15:48 Mattias Jiderhamn написал(a):
   
 If I understand your question: the reason the DispatchResponse is
 committed is that you have called .flush() explicitly on the original
 HttpServletRequest (HttpResponse).
 
 Yeah, that's what I did exactly. It would have committed it even if I didn't, 
 provided I print enough text into out.

   
 This is nothing strange. Why could you want to create a wrapper to
 hide the commited state, so that you can perform forward???
 forward means instead of
 include means also
 
 Well, the problem is that:
 include is like
 page - include page
 but including struts1 action is like
 page - include (forward - forward - forward - forward - page)

 The problem is that resin would not let me to forward, normally, when I 
 include() such chain and buffer is already committed.
 This is wrong for two reasons: first, forward() in included servlet does not 
 mean instead of including page but instead of included page, and second, 
 inclue()ing document should I guess yield same result as fetching it via HTTP 
 and then pasting.

   
 You cannot first generate or include content, flush it to the client
 (sent over the network to the web browser) and then say Oh wait, I
 changed my mind, I want to send this content instead (=forward).
 
 Nope. I've changed my mind inside included document, I want to send different 
 content *to be included*.

 In fact, included document should have own distinct stream which itself might 
 be committed or not, can be reset and so on..
 Resin cheats this for speed and thus have only one stream for both main and 
 included documents.
 But that breaks struts.

   
 If your design requires that the response is not commited, there is
 something wrong with your desing.
 
 Sorry, can't do anything with that. Need to do actual work instead of 
 rewriting struts.

   
 An alternative approach, if for some reason you must do it this way, is
 to create wrapper classes that put the included content in a buffer
 (think ByteArrayOutputStream) until you are sure you want to send it to
 the client, then you write the buffer to the actual response.
 

 What about my anonymous wrapper? See reply to original post.


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Resin 3.1, RequestDispatcher, include() and forward()

2008-02-27 Thread Huitang Li
This is an excellent finding. I got the same IllegalStateExceptions as 
well when jsp:include a struts1 action with resin 3.1.4.

I tested with struts 1.0.x, 1.1.x, and 1.2.x, I got the same error. 
However, when I tried struts 1.3.8, this exception disappeared.

I posted the similar question on the list several weeks ago, and I was 
suggested to use the switch flush=false, which actually did not make 
any difference.

If anyone knows the solution for avoiding this exception with struts 
versions less than 1.3.x, please let me know.


Thanks.



Ilya Kasnacheev wrote:
 I've found one thing in resin 3.1 regarding RequestDispatcher, include() and 
 forward()

 Let's suppose we have a ServletResponse, and we've wrote some text into its 
 output stream, so it's now in committed state.
 That means, as J2EE spec tells, that we can no longer do forward() on it, or 
 we'll get an IllegalStateException. In the meantime we can do include() on 
 it, including the response from random URI into result document.

 So we include() a chain of struts1 actions into it.
 They're going to forward() the request until the end of chain is reached.
 As I've found out, this will result in a shower of IllegalStateExceptions 
 being thrown. Interesting thing that, despite those exceptions, actions 
 successfully transfer control from one to another, eventually finishing 
 processing and writing everything they need to.

 Now the weird thing is:

 On the first side, include()d document can be thought as being processed 
 independently. Basically it should behave as if you fetched that page by 
 using HTTP and then printed it into output stream. So, forward() should work 
 because there is no reason for it to not work - because it would work in the 
 case of outside request.
 On the second side, include()d document gets unmodified ServletResponse from 
 parent servlet, which have its buffer committed, and I guess there are no 
 easy ways to tell whenever forward() was called from include()d servlet, 
 where it is fine, or from the parent servlet, where it's a no-no

 I can't say I have a question about resin, I just wanted to share that bunch 
 of facts and thoughts with you.

 P.S. Having said that, I find the original limitation on forward() rather 
 annoying. I guess it's supposed to ensure cookies and headers neither being 
 written into document nor discarded, and also prevent from outputting half of 
 one html document and then outputting the whole another html document.

 That's the well known We didn't want to let you shoot yourself in the foot 
 so 
 we duct taped your fingers together; and also, we wanted to prematurely 
 optimise a bit antipattern clearly.


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] org.apache.axis2.AxisFault: org.xml.sax.SAXParseException: The prefix ns2 for element ns2:requestUser is not bound.

2007-10-09 Thread Huitang Li
It sounds great, and especially thanks for the update from resin 
developers. When this is solved, axis users will not need to manually 
modify the axis2-generated stub code.  Looking forward to it ...


Huitang


Emil Ong wrote:
 --- Huitang Li [EMAIL PROTECTED] wrote:

   
 I found the cause of the problem by debugging the resin 3.1.3
 source code.

 The problem is caused by the setPrefix() method in the class 
 XMLStreamWriterImpl (the implementation class of XMLStreamWriter). 
 Whenever this method is called, by default the namespace will not
 be 
 included in generating the element. I did not look at the Axis2 
 implemention of this XMLStreamWriter yet. However, axis2 does not
 have 
 this side effect when the setPrefix() is called. Not sure whether
 this 
 is a bug for resin or not. It would be awesome if resin developers
 can 
 consider this case when they modify XMLStreamWriterImpl class.
 

 Hi Huitang,

 Thanks for tracking this down for us.  I think this is the same bug
 as this one:

 http://bugs.caucho.com/view.php?id=1989

 but I couldn't reproduce it before.  I'll take a look at the code and
 see if I can get this fixed for the next snapshot.

 Thanks again,
 Emil

 

 Emil Ong
 Software Engineer
 Caucho Technology, Inc.
 Tel. (858) 456-0300
 mailto:[EMAIL PROTECTED]

 Caucho: Reliable Open Source
 -- Resin: application server
 -- Quercus: PHP in Java
 -- Hessian Web Services


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] org.apache.axis2.AxisFault: org.xml.sax.SAXParseException: The prefix ns2 for element ns2:requestUser is not bound.

2007-10-06 Thread Huitang Li
Anyone has the answer?

I tested with a public accessible web service, and it has the same 
result. If you want to test it out, please see the web service 
http://www.tilisoft.com/ws/LocInfo/ZipCode.asmx
You can get its wsdl here: 
http://www.tilisoft.com/ws/LocInfo/ZipCode.asmx?WSDL
Follow the steps of Axis2 1.3 to generate axis adb client and then test 
the generated stub code.

It runs ok if the code is not run in resin environment. 

The soap message incorrectly created in resin environment is:

?xml version=1.0 encoding=UTF-8?
soapenv:Envelope 
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
soapenv:Body xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
ns1:GetDistance ==  the 
namespace is missing when the code is run with resin in non-debugging mode.
...
/soapenv:Body
/soapenv:Envelope

The soap message correctly created in resin remote-debugging or when the 
resin is not involved:

?xml version=1.0 encoding=UTF-8?
soapenv:Envelope 
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
soapenv:Body xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
ns1:GetDistance 
xmlns:ns1=http://www.tilisoft.com/ws/LocInfo/literalTypes;== The 
namespace is correctly put there in remote-debugging resin or non-resin 
environments.
...
/soapenv:Body
/soapenv:Envelope

So, my question is: how can the soap message be created correctly in 
resin remote-debugging mode while it is incorrectly created when resin 
is not running in remote-debugging mode?



Thanks.




Huitang Li wrote:
 Hi,

 I created web service client based on a wsdl. If the web service client 
 is run in resin 3.1.2 with jdk 1.5.0_10, it threw out the following 
 exception:

 org.apache.axis2.AxisFault: org.xml.sax.SAXParseException: The prefix 
 ns2 for element ns2:requestUser is not bound.
 at 
 org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
 at 
 org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
 at 
 org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
 at 
 org.apache.axis2.description.OutInAxisOperationClient$NonBlockingInvocationWorker.run(OutInAxisOperation.java:414)
 at 
 edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
 at 
 edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
 at java.lang.Thread.run(Thread.java:595)

 However, when the web service client code is run in unit tests without 
 the resin running. It works fine. I am not sure whether this exception 
 is caused by resin or something else.

 I did google searches for this problem, and found the following posting, 
 which means that it is more likely a server-related (or j2ee-related) 
 issue. I do not know whether resin needs to fix something like it or not:
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509784

 If you have experienced something like this before, please let me know 
 your solution or your findings. Thanks in advance.






 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] resin 3.1 JAX-WS exception

2007-09-13 Thread Huitang Li
Thanks very much. I used resin 3.1.0. Now I downloaded 3.1.2, and it works now.

Also, Apache axis2 failed to install at 3.1.0, while it succeeded in 3.1.2



  Hi,
  
  I downloaded the code in 
  http://www.caucho.com/resin-3.1/examples/soa-jaxws/index.xtp and 
  installed in resin 3.1.

 Which version of Resin exactly did you download?  Was it 3.1.0 or
 3.1.1, etc.?

 I just fixed a bug in that demo for 3.1.3, due out in a couple weeks.

 Thanks,
 Emil



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] resin 3.1 JAX-WS exception

2007-09-12 Thread Huitang Li
Hi,

I downloaded the code in 
http://www.caucho.com/resin-3.1/examples/soa-jaxws/index.xtp and 
installed in resin 3.1.

The following exception is shown when accessing the demo.jsp:

java.lang.NullPointerException
[17:21:55.828] at 
com.caucho.jaxb.skeleton.SkeletonProperty.write(SkeletonProperty.java:82)
[17:21:55.828] at 
com.caucho.soap.skeleton.OutParameterMarshal.serializeReply(OutParameterMarshal.java:89)
[17:21:55.828] at 
com.caucho.soap.skeleton.DocumentWrappedAction.invoke(DocumentWrappedAction.java:222)
[17:21:55.828] at 
com.caucho.soap.skeleton.DirectSkeleton.invoke(DirectSkeleton.java:274)
[17:21:55.828] at 
com.caucho.soa.encoding.SoapEncoding.invoke(SoapEncoding.java:85)
[17:21:55.828] at 
com.caucho.soa.servlet.SoapProtocolServlet.service(SoapProtocolServlet.java:77)
[17:21:55.828] at 
com.caucho.server.dispatch.WebServiceFilterChain.doFilter(WebServiceFilterChain.java:108)
[17:21:55.828] at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:167)
[17:21:55.828] at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:226)
[17:21:55.828] at 
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
[17:21:55.828] at 
com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)
[17:21:55.828] at 
com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:591)
[17:21:55.828] at 
com.caucho.util.ThreadPool$Item.run(ThreadPool.java:513)
[17:21:55.828] at java.lang.Thread.run(Thread.java:595)
[17:21:55.828] [7] HTTP/1.1 500 Internal Server Error
[17:21:55.828] [7] Transfer-Encoding: chunked
[17:21:55.828] [7] write-chunk(7)
[17:21:55.828] [7] keepalive
[17:21:55.828] java.lang.ClassCastException: java.lang.Integer
[17:21:55.828] at $Proxy8.getUsers(Unknown Source)
[17:21:55.828] at _jsp._demo__jsp._jspService(_demo__jsp.java:40)
[17:21:55.828] at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
[17:21:55.828] at com.caucho.jsp.Page.pageservice(Page.java:577)
[17:21:55.828] at 
com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:190)
[17:21:55.828] at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:167)
[17:21:55.828] at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:226)
[17:21:55.828] at 
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
[17:21:55.828] at 
com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)
[17:21:55.828] at 
com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:591)
[17:21:55.828] at 
com.caucho.util.ThreadPool$Item.run(ThreadPool.java:513)
[17:21:55.828] at java.lang.Thread.run(Thread.java:595)


Does anyone know why it is complaining like this?

Thanks.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] document-directory (Access is denied)

2007-04-03 Thread Huitang Li
Hi,

I got the following error:

java.io.FileNotFoundException: path of the docuement-directory in 
resin.conf (Access is denied)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.init(FileInputStream.java:106)
 at com.caucho.vfs.FilePath.openReadImpl(FilePath.java:403)
 at com.caucho.vfs.Path.openRead(Path.java:934)
 at 
com.caucho.server.webapp.ServletContextImpl.getResourceAsStream(ServletContextImpl.java:282)
 at 
com.caucho.server.dispatch.ServletMapper.mapServlet(ServletMapper.java:233)
 at 
com.caucho.server.webapp.Application.buildInvocation(Application.java:1828)
 at 
com.caucho.server.webapp.ApplicationContainer.buildInvocation(ApplicationContainer.java:728)
 at com.caucho.server.host.Host.buildInvocation(Host.java:459)
 at 
com.caucho.server.host.HostContainer.buildInvocation(HostContainer.java:353)
 at 
com.caucho.server.resin.ServletServer.buildInvocation(ServletServer.java:653)
 at 
com.caucho.server.dispatch.DispatchServer.buildInvocation(DispatchServer.java:198)
 at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:269)
 at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
 at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
 at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
 at java.lang.Thread.run(Thread.java:595)

I am running resin 3.0.22. I have used this version for several months, 
and this is the first time for me to get this error. When I checked out 
a clean copy of the code from cvs and started resin, I did not get this 
error. And this happens to one web application only. I can access other 
web applications in resin without any problem.

Any idea?

Thanks.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] resin 3.0.22 with cybersource SCMP ICSClient request exception

2007-01-18 Thread Huitang Li
Hi,

Previously our cybersource SCMP codes worked with jdk 1.4.2 and resin 
2.1.11.

Then, we switched to jdk 1.5.0_10 and resin 3.0.22, and we got this 
exception when trying to sending out a SMCP request:

java.lang.NoClassDefFoundError: com/sun/mail/util/LineOutputStream

[14:45:48.875] at 
javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1333)

[14:45:48.875] at 
javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)

[14:45:48.875] at 
com.cybersource.security.mime.MimeParser.encode(MimeParser.java:145)

[14:45:48.875] at 
com.cybersource.security.message.scmp.SCMPMessaging.composeSCMPMessage(SCMPMessaging.java:82)
 


[14:45:48.875] at 
com.cybersource.ics.client.ICSClientMessageManager.sendMessage(ICSClientMessageManager.java:232)
 


[14:45:48.875] at 
com.cybersource.ics.client.ICSClientMessageManager.send(ICSClientMessageManager.java:155)
 


[14:45:48.875] at 
com.cybersource.ics.client.ICSClient.send(ICSClient.java:318)

Actually, mail.jar is in classpath. However, it could not find the class 
com/sun/mail/util/LineOutputStream

Any idea?

Thanks.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest