Win a copy of Rust Web Development this week in the Other Languages forum!

Sankar Tanguturi

Greenhorn
+ Follow
since Feb 18, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sankar Tanguturi

From my client program deployed on the same machine as the service(in fact it is in the same EAR), I tried https://localhost/service, https://myserver:443/service and https://localhost:443/service. None of them work. However from the browser, both https://myserver:443/service and https://myserver/service seem to work. Please help. I have run of things I can try.
17 years ago
There is no firewall as the server and my machine are on the internal network. Even if that were the case, should the problem arise when connecting from my workstation rather than from the server, where the web service resides ?
17 years ago
Hi,

I am trying to connect to a WebService over SSL, from a Web client developed on WSAD, by updating the system properties in a static bloc in ServiceLocator file generated from WSDL :

//Update the system properties
Properties properties = System.getProperties();
properties.put("java.protocol.handler.pkgs",
"com.ibm.net.ssl.internal.www.protocol");
//New parameter
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
properties.put("javax.net.ssl.trustStore","trust.jks" );
properties.put("javax.net.ssl.trustStorePassword",trustpassword);
System.setProperties(properties);
}.

I changed the web service URL to point to my server running in production environment (on Websphere 5 app server). In my trust.jks file, I have imported the public key for the server.

With this setup, I am able to initiate a session to the server from my local workstation and get results successfully. However, when I move this application to production, I get the following error below. I am ensuring that the trust file is available on production also. Any ideas on why this might be happening ?

Thanks in advance,
Sankar


java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at com.ibm.jsse.bd.<init>(Unknown Source)
at com.ibm.jsse.JSSESocketFactory.createSocket(Unknown Source)
at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create
(JSSESocketFactory.java:198)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.getSocket(HTT
PSender.java:225)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSe
nder.java:143)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandler
Wrapper.java:217)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEng
ine.java:258)
at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connecti
on.java:680)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.jav
a:604)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.jav
a:434)
at com.ibm.ws.webservices.engine.client.Stub$Invoke.invoke(Stub.java:666
)
at com.agac.rateengine.ejb.RateEngineWsSessionSoapBindingStub.getWsPlanD
ictionaryForGroup(RateEngineWsSessionSoapBindingStub.java:268)
at java.lang.reflect.Method.invoke(Native Method)
at com.agac.rateengine.ejb.RateEngineClient.GetPlanDictionaryAndRates(Ra
teEngineClient.java:178)
at com.agac.rateengine.ejb.RateEngineClient.run(RateEngineClient.java:38
)
at org.apache.jsp._Result._jspService(_Result.java:213)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.j
ava:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.serv
ice(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServ
let.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.jav
a:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(Stric
tServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(Stric
tLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictL
ifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(Strict
LifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstan
ce.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(V
alidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(Ser
vletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDi
spatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAp
pRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebApp
RequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.jav
a:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebApp
Invoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvoc
ation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(Ser
vletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSE
Listener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnect
ion.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja
va:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
17 years ago
Hi,
I need to round some numbers to 2 decimal points. Since Math.round only rounds to nearest integer, I tried this approach: I multiplied the number by 100, rounded and then divided by 100 again.
For example,
to round .125 to 2 decimal points, I do this
float oldVal = 0.125;
float roundedVal = Math.round(oldVal * 100)/100;
This seems to work for most numbers. But when the 3rd decimal point has a 5, e.g., .125 and .175, I seem to be getting inconsistent answers.
.125 is rounded to .13 (rounded up), but .175 becomes .17 (rounded down).
Can anyone sugeggest a way to get a consistent answer ?
Thanks,
Sankar
17 years ago
Hi,
I have been trying to send SAX events to TransformerHandler to transform XML. I pass a templates object while creating the TransformerHandler. I am using xalan 2.5 along with xercesImpl and xml-apis.jar files that ship with xalan for my test. I am finding that the style sheet does not match any of the XML elements. However, a transformation using transformer.transform() works and gives correct results.

I have experimented with all xalan versions (2.1 through 2.6) and found that the same code that uses TransformerHandler works fine when using xalan 2.1. After that, it does not seem to be working. Is this a known bug ? How do I get around it ?

I am attaching a test program I have used for my testing .

Thanks in advance for your help.

Regards,
Sankar

---------------------------------------------------------------------
//Source code for Java Program
import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.sax.*;
import javax.xml.transform.stream.*;
import org.xml.sax.*;
import org.xml.sax.helpers.AttributesImpl;
/**
* Program to test Transformation using TransformerHandler that uses Templates
*/
public class SimpleXSLProcessor
{
public static void main(String[] args) throws Exception
{
// Specify XML Name,
if (args.length == 0)
{
System.err.println(
"Usage: java "
+ SimpleXSLProcessor.class.getName()
+ " [useTransformerHandler] [xsltFile] <xmlFile>");
System.err.println(" - useTransformerHandler is required");
System.err.println(" - xsltFile is required");
System.err.println(" - xmlFile is optional if useTransformerHandler is 'Y' ");
System.exit(1);
}
boolean useTransformerHandler = args[0].equalsIgnoreCase("Y") ? true: false;
String xsltFileName = (args.length > 1) ? args[1] : null;
String xmlFileName = (args.length > 2) ? args[2] : null;

TransformerFactory transFact = TransformerFactory.newInstance();
if (transFact.getFeature(SAXTransformerFactory.FEATURE))
{
SAXTransformerFactory saxTransFact =
(SAXTransformerFactory)transFact;
TransformerHandler transHand = null;

if (!useTransformerHandler)
{
System.out.println(" Transformation Output Using Transformer :");
Transformer transformer = saxTransFact.newTransformer( new StreamSource(new File(xsltFileName)));
transformer.transform(new StreamSource(new File(xmlFileName)),new StreamResult(System.out));
}
else
{
System.out.println(" Transformation Output Using TransformerHandler :");
javax.xml.transform.Templates templates = saxTransFact.newTemplates( new StreamSource(new File(xsltFileName)) );
transHand = saxTransFact.newTransformerHandler(templates);
// set the destination for the XSLT transformation
transHand.setResult(new StreamResult(System.out));
Generate(transHand);
}
}
else
{
System.err.println("SAXTransformerFactory is not supported.");
System.exit(1);
}
}

//Create SAX events to be sent to content handler of TransformerHandler
static void Generate(org.xml.sax.ContentHandler aContent) throws Exception
{
aContent.startDocument();
// Now we can actually write the date out.
AttributesImpl atts = new AttributesImpl();

atts.addAttribute("", "", "state", "CDATA", "NJ");
atts.addAttribute("", "", "zip", "CDATA", "07753");
atts.addAttribute("", "", "sicname", "CDATA", "Veterinary Services, Animal Specialties");
atts.addAttribute("", "", "siccode", "CDATA", "0742");
atts.addAttribute("", "", "rep", "CDATA", "sankar");
atts.addAttribute("", "", "pdate", "CDATA", "April 9, 2004" );
atts.addAttribute("", "", "edate", "CDATA", "May 1, 2004");
atts.addAttribute("", "", "vdate", "CDATA", "May, 2004");
atts.addAttribute("", "", "name", "CDATA", "TESTPDF");
atts.addAttribute("", "", "timestamp", "CDATA", "April 9, 2004 10:19:33 AM");
atts.addAttribute("", "", "lives", "CDATA", "8");
atts.addAttribute("", "", "insured", "CDATA", "8");
atts.addAttribute("", "", "logo", "CDATA", "C:\\logo.gif");
aContent.startElement("", "", "root", atts);
aContent.startElement("", "", "cover", new AttributesImpl());
aContent.endElement("", "", "cover");
aContent.endElement("", "", "root");
aContent.endDocument();
}
}

------------------------------------------------------------------
// XSL File


<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:template match='/root'>
Found the root
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='cover'>
Found the cover
</xsl:template>
</xsl:stylesheet>


-------------------------------------------------------------------
// XML File

<?xml version="1.0" encoding="UTF-8"?>
<root state="NJ" zip="07753" sicname="Veterinary Services, Animal Specialties" siccode="0742" rep="sankar" pdate="April 9, 2004" edate="May 1, 2004" vdate="May, 2004" name="testpdf" timestamp="April 9, 2004 10:19:33 AM" lives="8" insured="8" logo="logo.gif"><cover/></root>

---------------------------------------------------

//Output from my program

C:\Sankar\Programs\XMLTest>java -classpath .;xalan.jar;xml-apis.jar;xercesImpl.jar SimpleXSLProcessor Y identity.xsl
Transformation Output Using TransformerHandler :
<?xml version="1.0" encoding="UTF-8"?>

C:\Sankar\Programs\XMLTest>java -classpath .;xalan.jar;xml-apis.jar;xercesImpl.jar SimpleXSLProcessor N identity.xsl source.xml
Transformation Output Using Transformer :
<?xml version="1.0" encoding="UTF-8"?>
Found the root
Found the cover
Hi,
I am trying to access a web service on a public site going though our company's authenticating proxy server. My client is a web application running within WSAD 5.1. I was able to access the same service in the test environment(without going through proxy) with no problems. For the proxy, I am setting the following system properties :
System.setProperty( "proxySet", "true" );
System.setProperty( "http.proxyHost", "proxy_name");
System.setProperty( "http.proxyPort", "port_no" );
System.setProperty("http.proxyUser", "userid");
System.setProperty("http.proxyPassword", "password");
However, it does not seem to work. I am getting the following error message :
[11/17/03 16:53:32:023 EST] 2225910f enterprise I com.ibm.ws.webservices.engine.enterprise WSWS3243I: Info: Mapping Exception to WebServicesFault.
[11/17/03 16:53:32:043 EST] 2225910f enterprise I com.ibm.ws.webservices.engine.enterprise TRAS0014I: The following exception was logged WebServicesFault
faultCode: {http://websphere.ibm.com/webservices/}Server.generalException
faultString: java.net.ConnectException: Operation timed out: connect
faultActor: null
faultDetail:
stackTrace: java.net.ConnectException: Operation timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:345)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:157)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:144)
at java.net.Socket.(Socket.java:294)
at java.net.Socket.(Socket.java:121)
at com.ibm.jsse.bd.(Unknown Source)
at com.ibm.jsse.JSSESocketFactory.createSocket(Unknown Source)
at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create(JSSESocketFactory.java:198)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.getSocket(HTTPSender.java:225)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:143)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:217)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:258)
at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connection.java:680)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:604)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:434)
at com.ibm.ws.webservices.engine.client.Stub$Invoke.invoke(Stub.java:666)
at com.agac.rateengine.ejb.RateEngineWsSessionSoapBindingStub.getWsPlanDictionaryForGroup(RateEngineWsSessionSoapBindingStub.java:252)
at java.lang.reflect.Method.invoke(Native Method)
at com.agac.rateengine.ejb.RateEngineClient.GetPlanDictionaryAndRates(RateEngineClient.java:102)
at com.agac.rateengine.ejb.RateEngineClient.run(RateEngineClient.java:28)
at org.apache.jsp._Result._jspService(_Result.java:235)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
It appears to me that it is not even trying to contact the proxy as it does not give any authentication errors. Any ideas on fixing this ?
Thanks,
Sankar
Hi,
The link you provided seems to be for Apache's SOAP implementation. I generated the web service from an EJB using WSAD. I do not see any of the classes mentioned in the article, in my code. I also tried to set proxy user id and password using :

System.setProperty("http.proxyUser", "id");
System.setProperty("http.proxyPassword", "password");
But that did not help. I really appreciate any suggestions to resolve this.
Thanks,
Sankar
18 years ago
Hi,
I tried setting http.proxyHost and http.proxyPort. But I got the following error. However, I can get to the service through a browser. Do I need to specify the user id and password for the proxy ? I developed the client code in WSAD 5.1 in case that matters.
Thanks in advance,
Sankar
[11/17/03 16:53:32:023 EST] 2225910f enterprise I com.ibm.ws.webservices.engine.enterprise WSWS3243I: Info: Mapping Exception to WebServicesFault.
[11/17/03 16:53:32:043 EST] 2225910f enterprise I com.ibm.ws.webservices.engine.enterprise TRAS0014I: The following exception was logged WebServicesFault
faultCode: {http://websphere.ibm.com/webservices/}Server.generalException
faultString: java.net.ConnectException: Operation timed out: connect
faultActor: null
faultDetail:
stackTrace: java.net.ConnectException: Operation timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:345)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:157)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:144)
at java.net.Socket.<init>(Socket.java:294)
at java.net.Socket.<init>(Socket.java:121)
at com.ibm.jsse.bd.<init>(Unknown Source)
at com.ibm.jsse.JSSESocketFactory.createSocket(Unknown Source)
at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create(JSSESocketFactory.java:198)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.getSocket(HTTPSender.java:225)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:143)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:217)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:258)
at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connection.java:680)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:604)
at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:434)
at com.ibm.ws.webservices.engine.client.Stub$Invoke.invoke(Stub.java:666)
at com.agac.rateengine.ejb.RateEngineWsSessionSoapBindingStub.getWsPlanDictionaryForGroup(RateEngineWsSessionSoapBindingStub.java:252)
at java.lang.reflect.Method.invoke(Native Method)
at com.agac.rateengine.ejb.RateEngineClient.GetPlanDictionaryAndRates(RateEngineClient.java:102)
at com.agac.rateengine.ejb.RateEngineClient.run(RateEngineClient.java:28)
at org.apache.jsp._Result._jspService(_Result.java:235)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:435)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
18 years ago
Hi,
I want to access a web service on a public site from my Java web client, created using WSAD 5.1. However, I need to go though a proxy to connect to the internet. How do I make pass the proxy info to the client ?
Thanks,
Sankar
18 years ago
Hi,
I tried to create a web service for a stateless EJB using WSAD 5.0. After the web service was created, I got a message saying that some of the types were invalid. I noticed for a couple of XSD files generated for the classes used by the service, there were error messsages. The source seems to be failure to read some imported schemas. But some other XSDs that had similar import statements had no errors. Can any one help me figure out what is wrong ?
Here are the messages WSAD reported for one XSD :
KindStatusPriorityDescriptionResourceIn FolderLocation
Warningsrc-import.0: Failed to read imported schema document 'http://schemas.xmlsoap.org/wsdl/'.WsPlan.xsdRateEngineWSWeb/Web Content/wsdl/com/agac/rateengine/wsline 9
Warningsrc-import.0: Failed to read imported schema document 'http://schemas.xmlsoap.org/wsdl/'.WsPlan.xsdRateEngineWSWeb/Web Content/wsdl/com/agac/rateengine/wsline 9
Warningsrc-import.0: Failed to read imported schema document 'http://schemas.xmlsoap.org/soap/encoding/'.WsPlan.xsdRateEngineWSWeb/Web Content/wsdl/com/agac/rateengine/wsline 10
Warningsrc-import.0: Failed to read imported schema document 'http://schemas.xmlsoap.org/soap/encoding/'.WsPlan.xsdRateEngineWSWeb/Web Content/wsdl/com/agac/rateengine/wsline 10
Errorsrc-resolve: Cannot resolve the name 'soapenc:Array' to a(n) type definition component.WsPlan.xsdRateEngineWSWeb/Web Content/wsdl/com/agac/rateengine/wsline 13
Errorsrc-resolve: Cannot resolve the name 'soapenc:Array' to a(n) type definition component.WsPlan.xsdRateEngineWSWeb/Web Content/wsdl/com/agac/rateengine/wsline 13
Thanks,
Sankar
18 years ago
Hi,
I am running a webservices application using Apache AXIS on WSAD 5.0 on Windows NT 4.0. When I try to access one of the pages(specifically, to view WSDL for a service that has handlers defined fot it), I get the following exception :
[9/17/03 13:28:29:323 EDT] 41b4d9 WebGroup E SRVE0026E: [Servlet Error]-[org/apache/axis/handlers/BasicHandler]: java.lang.NoClassDefFoundError: org/apache/axis/handlers/BasicHandler
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:381)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.ReloadableClassLoader.loadClass(ReloadableClassLoader.java:76)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.ReloadableClassLoader.loadClass(ReloadableClassLoader.java:76)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))
at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:171)
at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:112)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getJavaClass(WSDDDeployableItem.java:391)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableItem.java:333)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:312)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:298)
at org.apache.axis.deployment.wsdd.WSDDChain.makeNewInstance(WSDDChain.java:169)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:312)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:298)
at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:411)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:312)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:298)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.java:492)
at org.apache.axis.configuration.FileProvider.getService(FileProvider.java:262)
at org.apache.axis.AxisEngine.getService(AxisEngine.java:275)
at org.apache.axis.MessageContext.setTargetService(MessageContext.java:586)
at org.apache.axis.handlers.http.URLMapper.invoke(URLMapper.java:89)
at org.apache.axis.handlers.http.URLMapper.generateWSDL(URLMapper.java:97)
at org.apache.axis.strategies.WSDLGenStrategy.visit(WSDLGenStrategy.java:72)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
at org.apache.axis.SimpleChain.generateWSDL(SimpleChain.java:143)
at org.apache.axis.server.AxisServer.generateWSDL(AxisServer.java:456)
at org.apache.axis.transport.http.AxisServlet.processWsdlRequest(AxisServlet.java:428)
at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:280)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)
The class it is looking for is in axis.jar and it exists in the web module under Web Content\web-inf\lib folder. However, it WSAD does not seem to pick it up. There were no problems while building the web module. I tried adding the jar to the libraries used by web module, but that did not fix the problem either.
The only way around it seems to be to add the required jar to ws.ext.dirs, the external directories used by WSAD. However, I think this may not be permissible when we deploy the application. Are there any alternatives ?
Thanks,
Sankar
18 years ago
I did not show the exception handling, but it exists . What I showed is an extract from a larger program.
Hi,

I am not sure if this is the right forum. But since my problem involves using TransformerHandlers, I am posting it here.
I am trying to port a web application that from Oracle9iAS to Websphere 5.0. I am getting a problem on Websphere, when I try to get a TransformerHandler from TransformerFactory and using TransformerHandler as a ContentHandler to fire SAX events. The transformation does not happen and I get an empty XML declaration in the output. I verified that if I do not specify the templates while getting the TransformerHandler, it is doing an identity transformation correctly. Also there are templates within my XSL to handle the XML tags.
Here is the outline of my code :
if( templates == null )
{
templates = TransformerFactory.newInstanc().newTemplates
(new StreamSource(new File("xml_to_fo.xsl")));
}
TransformerHandler hd = tf.newTransformerHandler
(templates);
Transformer serializer = hd.getTransformer();
serializer.setOutputProperty( OutputKeys.INDENT,"no" );
hd.setResult( new StreamResult(new File(OUTPUT_FILENAME) );
hd.startDocument();
..... // Code to add XML nodes to the document
hd.endDocument();
I tried 2 different approaches to troubleshoot this:
1) On Oracle9IAS I was using an older version on xalan. I thought that the problem may due to a bug in the xalan that ships with Websphere. So I changed the Application class loading mode to 'Parent Last' from 'Parent First' so that Websphere would pick my version of the xalan classes(under web-inf/classes/lib). That did not help. In both cases, when I printed the loader info, I got com.ibm.ws.bootstrap.ExtClassLoader@56fd9395 as class loader and sun.misc.Launcher$AppClassLoader@55021395 as parent loader.
2) Next I wrote a stand alone java program to test the transformation process with the xalan.jar version from websphere and the version I had from Oracle9iAS. I found that with both versions of the jar, transformation happened correctly. I think this probably means that there is something wrong in the Websphere environment that is causing the problem. The stand alone program code is shown below :
TransformerFactory tf = TransformerFactory.newInstance();
Templates templates = tf.newTemplates(new StreamSource("xml_to_fo.xsl"));
TransformerHandler hd = ((SAXTransformerFactory)tf).newTransformerHandler
(templates );
Transformer transformer = hd.getTransformer();
transformer.transform(new StreamSource(new File("source.xml")), new StreamResult(System.out));
Any help in fixing the problem is appreciated.
Thanks,
Sankar
Hi,
I am trying to port a web application that from Oracle9iAS to Websphere 5.0. I am getting a problem on Websphere, when I try to get a TransformerHandler from TransformerFactory and using TransformerHandler as a ContentHandler to fire SAX events. The transformation does not happen and I get an empty XML declaration in the output. I verified that if I do not specify the templates while getting the TransformerHandler, it is doing an identity transformation correctly. Also there are templates within my XSL to handle the XML tags.
Here is the outline of my code :
if( templates == null )
{
templates = TransformerFactory.newInstanc().newTemplates
(new StreamSource(new File("xml_to_fo.xsl")));
}
TransformerHandler hd = tf.newTransformerHandler
(templates);
Transformer serializer = hd.getTransformer();
serializer.setOutputProperty( OutputKeys.INDENT,"no" );
hd.setResult( new StreamResult(new File(OUTPUT_FILENAME) );
hd.startDocument();
..... // Code to add XML nodes to the document
hd.endDocument();
I tried 2 different approaches to troubleshoot this:
1) On Oracle9IAS I was using an older version on xalan. I thought that the problem may due to a bug in the xalan that ships with Websphere. So I changed the Application class loading mode to 'Parent Last' from 'Parent First' so that Websphere would pick my version of the xalan classes(under web-inf/classes/lib). That did not help. In both cases, when I printed the loader info, I got com.ibm.ws.bootstrap.ExtClassLoader@56fd9395 as class loader and sun.misc.Launcher$AppClassLoader@55021395 as parent loader.
2) Next I wrote a stand alone java program to test the transformation process with the xalan.jar version from websphere and the version I had from Oracle9iAS. I found that with both versions of the jar, transformation happened correctly. I think this means that there is something wrong in the Websphere environment that is causing the problem. The stand alone program code is shown below :
TransformerFactory tf = TransformerFactory.newInstance();
Templates templates = tf.newTemplates(new StreamSource("xml_to_fo.xsl"));
TransformerHandler hd = ((SAXTransformerFactory)tf).newTransformerHandler
(templates );
Transformer transformer = hd.getTransformer();
transformer.transform(new StreamSource(new File("source.xml")), new StreamResult(System.out));
Any help in fixing the problem is appreciated.
Thanks,
Sankar
[ August 22, 2003: Message edited by: Sankar Tanguturi ]
18 years ago
Hi,
I did have my JAVA_HOME pointing to sun JDK, which I changed to point to Websphere's JDK. That did not help. I also noticed in the log the following error which seems to say that the bindings were not loaded.
[03.02.20 16:56:28:861 EST] 3d1326d8 ServletEngine A SRVE0169I: Loading Web Module: <null>.
[03.02.20 16:56:29:071 EST] 3d1326d8 WebApp X SRVE0142E: Failed to load WebApp Bindings javax.naming.InvalidNameException: Null names are not allowed.
at com.ibm.ws.naming.util.WsnName.setName(WsnName.java:930)
at com.ibm.ws.naming.util.WsnName.<init>(WsnName.java:184)
at com.ibm.ws.naming.util.WsnNameParser.parse(WsnNameParser.java:96)
at com.ibm.servlet.engine.webapp.WebApp.createContextsAndRebind(WebApp.java:895)
at com.ibm.servlet.engine.webapp.WebApp.populateJavaNameSpace(WebApp.java:842)
at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:125)
at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:234)
at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:139)
at com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:633)
at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:36)
at com.ibm.ws.runtime.Server.startModule(Server.java:615)
at com.ibm.ejs.sm.active.ActiveModule.startModule(ActiveModule.java:509)
at com.ibm.ejs.sm.active.ActiveModule.startAction(ActiveModule.java:355)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:709)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:131)
at com.ibm.ejs.sm.active.ActiveObject.operateOnContainedObjects(ActiveObject.java:609)
at com.ibm.ejs.sm.active.ActiveEJBServer.startAction(ActiveEJBServer.java:730)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:709)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:131)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:93)
at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:62)
at com.ibm.ejs.sm.agent._AdminAgentImpl_Tie._invoke(_AdminAgentImpl_Tie.java:80)
at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(ExtendedServerDelegate.java:506)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:2294)
at com.ibm.CORBA.iiop.OrbWorker.run(OrbWorker.java:185)
at com.ibm.ejs.oa.pool.ThreadPool$PooledWorker.run(ThreadPool.java:95)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)
-Sankar
18 years ago