Krishna, Alle

Greenhorn
+ Follow
since Nov 16, 2001
Merit badge: grant badges
For More
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 Krishna, Alle

Make sure you have your Tomcat Server running. Error 500 is received when you try to access a resource on an AppServer and it may be down.
19 years ago
JSP
I am trying to modify either the SOAP Body elements or the Header elements on the server side. I have written a handler that gets the request message and modifies it before reaching the server. But I am not able to modify.
A snippet of the SOAP message is given below:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:testMethod soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="LogTestService"/>
</soapenv:Body>
</soapenv:Envelope>
And I am trying to insert the following SOAPBodyElement into the above message:
<WOMBAT:GetLastTradePrice xmlns:WOMBAT="http://www.wombat.org/trader">
<ns1 rice xmlns:ns1="http://www.wombat.org/trade"/>
</WOMBAT:GetLastTradePrice>
But after I attach this element to the body, I cannot see this element in my modified SOAP Message.
I am using Axis 1.0 with Tomcat 4.0.6. Also, my code is below for quick reading.
package samples.userguide.example4;
import org.apache.axis.Handler;
import org.apache.axis.handlers.BasicHandler;
import org.apache.axis.AxisFault;
import org.apache.axis.MessageContext;
import org.apache.axis.Message;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeaderElement;
import org.apache.axis.message.MessageElement;
import org.apache.axis.encoding.Base64;
import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Element;
import javax.crypto.*;
import javax.xml.soap.*;
import java.util.*;
import java.io.*;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Date;
public class LogHandler extends BasicHandler {
public void invoke(MessageContext msgContext) throws AxisFault
{
/** Log an access each time we get invoked.
*/

String filename = (String)getOption("filename");
if ((filename == null) || (filename.equals("")))
throw new AxisFault("Server.NoLogFile",
"No log file configured for the LogHandler!",
null, null);


PrintWriter writer = null;

try {
Handler serviceHandler = msgContext.getService();

FileOutputStream fos = new FileOutputStream(filename, true);
writer = new PrintWriter(fos);

Integer numAccesses =
(Integer)serviceHandler.getOption("accesses");
if (numAccesses == null)
numAccesses = new Integer(0);

numAccesses = new Integer(numAccesses.intValue() + 1);

Date date = new Date();
String result = date + ": service " +
msgContext.getTargetService() +
" accessed " + numAccesses + " time(s).";
serviceHandler.setOption("accesses", numAccesses);

// get to the message
Message reqMessage = msgContext.getRequestMessage();
org.apache.axis.message.SOAPEnvelope env = (org.apache.axis.message.SOAPEnvelope)reqMessage.getSOAPEnvelope();

SOAPBody body = env.getBody();
Name name = env.createName("GetLastTradePrice", "WOMBAT", "http://www.wombat.org/trader");

SOAPElement bodyElement = body.addBodyElement(name);

Name nameEl = bodyElement.getElementName();
System.out.println("Local Name = " + nameEl.getLocalName());
System.out.println("Prefix = " + nameEl.getPrefix());
System.out.println("Qualified Name = " + nameEl.getQualifiedName());
System.out.println("URI = " + nameEl.getURI());

Name secRefList = env.createName("Price","WOMBAT","http://www.wombat.org/trade");
SOAPElement secRefListElem = bodyElement.addChildElement(secRefList);

Element bodyEl = ((org.apache.axis.message.SOAPBodyElement)bodyElement).getAsDOM();
writer.println("The SOAPBody Elem is: " + XMLUtils.ElementToString(bodyEl));

Element bodyWhole = ((org.apache.axis.message.SOAPBody)body).getAsDOM();
writer.println("\n\nThe SOAPBody is: " + XMLUtils.ElementToString(bodyWhole));

Element element = ((org.apache.axis.message.SOAPEnvelope)env).getAsDOM();
writer.println("\n\nThe SOAPENV after detaching SOAPBody Elem is: " + XMLUtils.ElementToString(element));

writer.println(result);

} catch (Exception e) {
writer.println("Exception in LOGHANDLER: " + e.getMessage());
e.printStackTrace();
throw AxisFault.makeFault(e);
} finally {
writer.close();
}
}
}
Any help is appreciated.
Thank you.
20 years ago
Hi,
Is there a way to create a .war file as a directory as opposed to a simple file. For ex,
I like to have the war file as a directory the following way.
mywar.war
- images
- META-INF
- WEB-INF
- abc.jsp
so that I can traverse to each directory beneath it.
I know that simply creating a war by:
jar -cvf mywar.war *
will only create a file.
Thanks.
21 years ago
There should not be any problem in using the "out" variable if buffer="none" as the response would still be commited to the client.
The only catch is that as long as autoFlush="true", it should be just fine.
Hi,
I have an html in a webapp called home and when I try to hit the html as http://localhost:8080/home/form1.html, I hit the following error. I am using Tomcat 4.1.12 on redhat Linux 8.0/kernel 2.4.18-14.
java.lang.NullPointerException
at HomeServlet.processRequest(HomeServlet.java:51)
at HomeServlet.doGet(HomeServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
I do not know why it is trying to call the servlet when I am trying to hit the html.
Can someone please clarify?
Thanks in advance.
21 years ago
Hi,
1) There can only be a single ServletContext for a web application and only one. This is true.
2) But when in a distributable web application, which spans across multpile JVMs, it can have again one and only one ServletContext.
3) Hanumant's book says, there can exist different ServletContexts on different machines.
Can someone please clarify if I have misunderstood the concept of ServletContext because I feel statements 2 and 3 above appear to contradict each other.
Thank you folks in advance.
Vasanth
The reason is you did not start adminserver.
On windows:
Go to the bin directory of WebSphere install root and then start the startupServer.bat script or start the WebSphere adminserver service from services.
On Unix:
Go the the WebSphere install root and then start the startupServer.sh script.
Either case, wait for the "open for e-business" string appears in the console.
Now you are ready to start the adminclient.
Hope this helps. Feel free to ask if you have any other problems.
21 years ago
Hi All,
I was reading the Servlet 2.3 spec for the SCWCD. The spec says that Servlet Containers must provide a private temporary directory per servlet context and make it available via a javax.servlet.context.tempdir
context attribute. Is this package somewhere present in individual or respective implementations of Servlet/Web Containers? This definitely is not part of the Servlet Extension API.
Can someone clarify this for me?
Thanks in advance.
Vasanth
I hope much of the talk is here about Oracle configuration with JBoss.
Can someone of you please point out where I can find the oracle-service.xml file? Please excuse me for my ignorance. I do not know if I need to create this somehow.
Thanks in advance.
21 years ago
Bill,
Thank you for the information. So is this some kind of limitation the Session Management API.
Once again, Thanks
Vasanth
21 years ago
JSP
Hi All,
I wanted to know when a session is invalidated with a HttpSession.invalidate() call, is the session object destroyed or are all the objects associated with the session are destroyed?
Snippet of the code I have in a JSP,
String inv = request.getParameter("action");
if(inv != null && inv.equals("invalidate")) {
session = request.getSession(true);
session.invalidate();
}
System.out.println("SESS = " + session);
String sessionAttr1 = (String)session.getAttribute("uid");
I get an IllegalStateException when the getAttibute method in the above piece of code is executed. But, I can see the print statement SESS shows a session.
FYI: I am using Orion Application Server, ver 1.5.2
Can someone let me know the answer. I appreciate the response in advance. Let me know if the question is ambiguous.
Thanks.
21 years ago
JSP
Hi Kyle,
All the other files which the EJBs are refering are inside the jar file and not the ear file. The jar of course is inside the
ear file.
Also, can you please let me know if any EJB 2.0 spec code can be
ported into IBM WebSphere 4.0. I know that IBM WebSphere 4.0
supports only EJB 1.1 spec.
Is it a possibility that the errors I might be seeing is because the of the EJB 2.0 spec code being tried to be deployed on IBM WebSphere 4.0?
Thanks
Vasanth
22 years ago
Hi Kyle,
They are EJB 1.1 EJBs.
thanks
22 years ago
Hi,
I am trying to deploy EJBs on Websphere 4.0 using the AAT tool.
I see a score of errors in the default_server_stdout.log. The same EJBs work fine on Orion Application Server 1.4.5. The error log is given below. Any help is highly appreciated.
Committing working copy...
[01.11.15 19:04:55:753 EST] 2a64d88e SystemOut U Updating.
[01.11.15 19:04:55:773 EST] 2a64d88e SystemOut U Building: /Deployed_ejbmg.jar.
[01.11.15 19:04:55:813 EST] 2a64d88e SystemOut U Invoking Java Builder on /Deployed_ejbmg.jar.
[01.11.15 19:04:56:044 EST] 2a64d88e SystemOut U Scrubbing output folder
[01.11.15 19:04:56:044 EST] 2a64d88e SystemOut U Analyzing packages
[01.11.15 19:04:56:064 EST] 2a64d88e SystemOut U Analyzing sources
[01.11.15 19:04:56:675 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/dp/EjbRemoteInterface
[01.11.15 19:04:56:815 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/extension/EjbRemoteInterface
[01.11.15 19:04:56:915 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/document/EjbRemoteInterface
[01.11.15 19:04:57:075 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/common/EjbRemoteInterface
[01.11.15 19:04:57:115 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/workflow/EjbRemoteInterface
[01.11.15 19:04:59:649 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/dp/EjbRemoteInterface
[01.11.15 19:05:01:281 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/extension/EjbRemoteInterface
[01.11.15 19:05:02:563 EST] 2a64d88e SystemOut U Compiling content of ejbModule/com/mi/smartpath/document/EjbRemoteInterface
[01.11.15 19:05:03:935 EST] 2a64d88e SystemOut U (257 problems found) Copying all resources on the classpath
[01.11.15 19:05:04:025 EST] 2a64d88e SystemOut U (257 problems found) Build done
[01.11.15 19:05:04:145 EST] 2a64d88e SystemOut U Java build completed
[01.11.15 19:05:04:145 EST] 2a64d88e SystemOut U Invoking Validation on /Deployed_ejbmg.jar.
[01.11.15 19:05:04:356 EST] 2a64d88e SystemOut U ejbModule/com/mi/smartpath/document/EjbRemoteInterface/EJSBMPPDBinderHomeBean.java(28): PDBinderBean cannot be resolved or is not a type
[01.11.15 19:05:04:356 EST] 2a64d88e SystemOut U ejbModule/com/mi/smartpath/document/EjbRemoteInterface/EJSBMPPDBinderHomeBean.java(28): PDBinderBean cannot be resolved or is not a type
[01.11.15 19:05:04:356 EST] 2a64d88e SystemOut U ejbModule/com/mi/smartpath/document/EjbRemoteInterface/EJSBMPPDBinderHomeBean.java(46): PDBinderBean cannot be resolved or is not a type
[01.11.15 19:05:04:356 EST] 2a64d88e SystemOut U ejbModule/com/mi/smartpath/document/EjbRemoteInterface/EJSBMPPDBinderHomeBean.java(46): PDBinderBean cannot be resolved or is not a type
[01.11.15 19:05:04:366 EST] 2a64d88e SystemOut U ejbModule/com/mi/smartpath/document/EjbRemoteInterface/EJSBMPPDBinderHom
Thanks
22 years ago