Sumit Bansal

Greenhorn
+ Follow
since Feb 27, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sumit Bansal

Hi Marco,

Thanks for reply.

one more query.. If a user login to an application using two different browser from same machine, would the same session Id be generated by container or there will be two different session id?
15 years ago
Hi,

HttpServletRequest interface has a method named getSession()
which says it returns the current session associated with this request, or if the request does not have a session, creates one.

My question is how is it identified by server, I mean the session belong to the current request?

Where does it search for the session which belongs to current request?

thank you
15 years ago
HashMap h1 = new HashMap();
h1.put("one", "one");
h1.put("two", "two");
h1.put("three", "three");
h1.put("four", "four");
h1.put("five", "five");
HashMap h2 = null;
1)//h2 = h1; // Assign reference directly
2)h2 = (HashMap)h1.clone(); // make a clone of the object
h1 = null;

If you try option (1) or (2), both gives the same result, i have tried it. then what is the difference between these two ways [except clone() instantiate a new object with same values]?
Also which one is more efficient and right to use?
16 years ago
Hi,
I am using <t:panelGrid> to display the combination of 5 radio buttons with corresponding <t:selectOneMenu>, such that each row contains a radiobutton and a dropdown.On selecting one radiobutton all others should be disabled with there corresponding dropdowns.
17 years ago
JSF
Hi,

I am trying to convert my Java Objects into XML file.
I got these Objects from XSD's using xjc .
I got the XML file but along with the namespace prefix(ns2) that i have not set.
The resulting XML is like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:authenticateAndAuthorize xmlns:ns2="http://www.XXXXX.com/AuthenticateAndAuthorize" xmlns="http://www.XXXXX.com/UserManagement">
<ns2:authentication>
<applicationId>0</applicationId>
</ns2:authentication>
<ns2:user>
<displayName>name</displayName>
<password>personal</password>
<registrationStatus>registered</registrationStatus>
</ns2:user>
</ns2:authenticateAndAuthorize>

Is there any way to remove/change this prefix (ns2)?

Any help would be appreciated.

Sumit
you rocked man.
No words to describe.
17 years ago
Thank you guys. thanks a lot for your wishes.

17 years ago
Hi,

i have cleared.
17 years ago
Thank you for such information.

thanks

Sumit Bansal
17 years ago
Hi folks,

While analysing websphere server i came across a BIG confusion.
Actually in WAS 6.1 there is

default Http transport Server

which act as a web server.
My Question are

if there is already a default server in it why

IBM Http Server

is for?

What is the advantage of using IBM Http in place of default http transport server?
Please clear this doubt.

thanks

Sumit Bansal
17 years ago
Hi friends,

Somebody might have asked this question before me and many of you might have known the answer. So please share it

It is a simple(may be stupid) question on Servlet.
At last servlet is a class and every class has its constructor. So Container must be calling that constructor in case of servlet for us.

Is that constructor really exists?

But what is in that constructor?

What would happen if we write our own constructor in a servlet?

Thank you,

Sumit
Thank you "Nitesh Kant"

you solved my problem. thanks a million to you.

"Mark"

i added my last name in my profile and double post for same topic is by mistake. I will take care of these thing in future.

Thank you

Sumit
While deploying EJB on Websphere i am getting following error

[3/27/07 17:20:02:117 IST] 00000022 SystemErr R javax.naming.CommunicationException: Cannot connect to ORB [Root exception is org.omg.CORBA.INTERNAL: CREATE_LISTENER_FAILED_4 vmcid: 0x49421000 minor code: 56 completed: No]
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:227)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:84)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:47)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:679)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:259)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at javax.naming.InitialContext.init(InitialContext.java:235)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at javax.naming.InitialContext.<init>(InitialContext.java:209)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.SelectServlet.doGet(SelectServlet.java:38)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
[3/27/07 17:20:02:195 IST] 00000022 SystemErr R Caused by: org.omg.CORBA.INTERNAL: CREATE_LISTENER_FAILED_4 vmcid: 0x49421000 minor code: 56 completed: No
at com.ibm.ws.orbimpl.transport.WSTransport.createListener(WSTransport.java:719)
at com.ibm.ws.orbimpl.transport.WSTransport.initTransports(WSTransport.java:591)
at com.ibm.rmi.iiop.TransportManager.initTransports(TransportManager.java:155)
at com.ibm.rmi.iiop.TransportManager.getServerIIOPProfile(TransportManager.java:162)
at com.ibm.rmi.iiop.ORB.getServerIIOPProfile(ORB.java:371)
at com.ibm.CORBA.iiop.ServerDelegate.getServerIIOPProfile(ServerDelegate.java:932)
at com.ibm.CORBA.poa.POAServerDelegate.getServerIIOPProfile(POAServerDelegate.java:585)
at com.ibm.rmi.poa.POAImpl.initializeTemplateProfile(POAImpl.java:233)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1231)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1662)
at org.omg.CORBA.ORB.init(ORB.java:364)
at com.sun.jndi.toolkit.corba.CorbaUtils.getOrb(CorbaUtils.java:202)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:219)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:84)
at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:47)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:679)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:259)
at javax.naming.InitialContext.init(InitialContext.java:235)
at javax.naming.InitialContext.<init>(InitialContext.java:209)
at com.SelectServlet.doGet(SelectServlet.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)

[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.ws.orbimpl.transport.WSTransport.createListener(WSTransport.java:719)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.ws.orbimpl.transport.WSTransport.initTransports(WSTransport.java:591)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.rmi.iiop.TransportManager.initTransports(TransportManager.java:155)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.rmi.iiop.TransportManager.getServerIIOPProfile(TransportManager.java:162)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.rmi.iiop.ORB.getServerIIOPProfile(ORB.java:371)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.CORBA.iiop.ServerDelegate.getServerIIOPProfile(ServerDelegate.java:932)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.CORBA.poa.POAServerDelegate.getServerIIOPProfile(POAServerDelegate.java:585)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.rmi.poa.POAImpl.initializeTemplateProfile(POAImpl.java:233)
[3/27/07 17:20:02:273 IST] 00000022 SystemErr R at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1231)
[3/27/07 17:20:02:289 IST] 00000022 SystemErr R at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1662)
[3/27/07 17:20:02:289 IST] 00000022 SystemErr R at org.omg.CORBA.ORB.init(ORB.java:364)
[3/27/07 17:20:02:289 IST] 00000022 SystemErr R at com.sun.jndi.toolkit.corba.CorbaUtils.getOrb(CorbaUtils.java:202)
[3/27/07 17:20:02:289 IST] 00000022 SystemErr R at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:219)
[3/27/07 17:20:02:289 IST] 00000022 SystemErr R ... 28 more


Here is the code snippet:

properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
properties.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
//here is the line i am getting this exception. I dont know where i am going wrong. I am using WebSphere 6.1
InitialContext initialcontext = new InitialContext(properties);

Please help me.

Thank you

Sumit
Hi,

I have checked the server is sending right type "text/xml".
Please just have a look on my code. Please Suggest me somthing I am new to WS.
*******************************************************
// creating a SOAP Message from StringBuffer to Input Stream to SOAP Msg
StringBuffer sb1 = new StringBuffer();
sb1.append("<?xml version='1.0' encoding='utf-8'?>");
sb1.append("<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>");
sb1.append("<soap:Body>");
sb1.append("<AuthenticateUser xmlns='http://LoginAuth.com/webservices'>");
sb1.append("<AuthKey>hjhjkhkjjkjk</AuthKey>");
sb1.append("</AuthenticateUser>");
sb1.append("</soap:Body>");
sb1.append("</soap:Envelope>");

String strSoap=sb1.toString();
//"strSoap" is the SOAP message i have to send to get a reply.

byte[] b = strSoap.getBytes("UTF-8");
InputStream in = new ByteArrayInputStream(b);

MimeHeaders mh = new MimeHeaders();
mh.setHeader("Content-Type", "text/xml");

MessageFactory mf = MessageFactory.newInstance();
SOAPMessage message = mf.createMessage(mh,in);

//Here I am getting the error..................
SOAPMessage reply = soapConnection.call(message, url);

.
.
.
The exception i am getting is..................

Mar 1, 2007 3:22:02 PM com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:296)
.
.
.
.
Exception caught:java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message

Sumit
17 years ago