Servlet Client
Hi
I was just making servlet client for my ejb but i face few problem the error is that EJB not bound in this context.
1) i making bean's jar file and then deploying it.
2) Then make servlet client .
3)Run the client form tomcat and EJB not bound in this context error comes.
What should i do, plz guide me on that speically lancea .
Regards
Uzair
Hi,
Chapter 24 of the J2EE tutorial has an example of what you are trying to do.
Please try and deploying the sample in the chapter as I suspect that will help.
Similar Messages
-
Hi,
Till now i had normal java client for my EJB Programs.. I use j2ee 1.4 AppServer
Whenever i run my java program i used to set classpath for the returned client jar file and appserv-rt.jar but now when i run my servlet client program i don know how to set them and hence when i run the servlet i get an error saying No class def found for home interface...
How do i rectify this?
Waiting for ur replies!
Thanks,
AkshathaHi,
Inspite of putting my jar file i am getting the no
class def found error. So how do i
proceed further?
AkshathaDid you put the EJB client jar in the WEB-INF/lib directory for your web application as suggested? -
Deployment Problem "Exit status of DCM servlet client: -1"
I had a "Exit status of DCM servlet client: -1" problem at deployment, which is not yet reported.
Deployment from Jdeveloper 10.1.3.0.4.3673 to Application server 10.1.2.0.2 on Windows 2003 Server works on "home" OC4J but not on newly created OC4J instance. After comparing the two instances, I found the difference in the application.xml file. The Runtime Installer adds a list of library path statements at the end of this file:
<library path="../../../jlib/commons-el.jar"/>
<library path="../../../jlib/oracle-el.jar"/>
When I add these statements to the application.xml file of the newly created OC4J instance, the deployment works.From the App Server oracle home, and with the same connection information as app is using, can you connect to 8.1.6 db with sqlplus?
You said it works from JDeveloper - which version?
From AS 10.1.2 (which means net/client libraries 10.1.0.3) I get
"ORA-03134: Connections to this server version are no longer supported."
To 8.1.7.4 database connection succeeds. (hint: 8.1.6 is not supported!)
Maybe this could be the culprit? -
IllegalArgumentException while accessing an EJB with a servlet client
Dear All,
Hey,
I am facing some problems while accessing a deployed stateless ejb. Following is how my application is being accessed:
WEBAPP CLIENT
caller.html ------->> DisplayServletClient --------->> DisplayServlet
(Simple HTML Page) (Servlet which performs lookup) (The actual bean)
CONSOLE CLIENT
DisplayConsoleClient --------->> DisplayServlet
(Simple Console Client) (The actual bean)
I am using the J2EE reference implementation, the ejb bean is successfully deployed. The console client successfully, access the ejb. But when I try to access the ejb using the webapp client, I get the following exception:
======= EXCEPTION ENCOUNTERED ============
Application DisplayApp deployed.
Servlet Entered
HTML Content Type Set
PrintWriter Object Created
Context Object Created
Exception in Servlet Client Code: java.lang.IllegalArgumentException: Unknown co
mponent type
java.lang.IllegalArgumentException: Unknown component type
at com.sun.enterprise.naming.NamingManagerImpl.getComponentType(NamingMa
nagerImpl.java:670)
at com.sun.enterprise.naming.NamingManagerImpl.getMangledIdName(NamingMa
nagerImpl.java:708)
at com.sun.enterprise.naming.NamingManagerImpl.getComponentIdInternal(Na
mingManagerImpl.java:680)
at com.sun.enterprise.naming.NamingManagerImpl.getComponentId(NamingMana
gerImpl.java:313)
at com.sun.enterprise.naming.java.javaURLContext.getComponentContext(jav
aURLContext.java:397)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
ava:51)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at DisplayServletClient.service(DisplayServletClient.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:428)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java
:180)
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(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationF
ilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
erChain.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:172)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:215)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2314)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.ja
va:368)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
r.java:995)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
va:1088)
at java.lang.Thread.run(Thread.java:484)
======== EXCEPTION END ===========
Tweaking with the servlet client code, I have discovered that it is failing to perform a correct lookup. Can anybody suggest any remedy? My Source code is below:
=========================================================
============ Remote Interface START ==============
// The DisplayApp Remote Interface File
import javax.ejb.*;
import java.rmi.*;
public interface Display extends EJBObject
public String display() throws RemoteException;
============ Remote Interface END ==============
============ Home Interface START ==============
// The DisplayApp Home Interface File
import javax.ejb.*;
import java.rmi.*;
public interface DisplayHome extends EJBHome
public Display create() throws RemoteException, CreateException;
============ Home Interface END ==============
============ Bean Class START ==============
// The DisplayApp Bean Class File
import javax.ejb.*;
import java.rmi.*;
public class DisplayBean implements SessionBean
public String display() throws RemoteException
System.out.println("The Server Side Response");
return "Hello, Me a New Friend";
public void ejbCreate(){}
public void ejbRemove(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void setSessionContext(SessionContext ctx){}
============ Bean Class END ==============
========== Console Client Class START ======
// The Display Console Client Class File
import javax.ejb.*;
import javax.rmi.*;
import javax.naming.*;
import Display;
import DisplayHome;
public class DisplayConsoleClient
public DisplayConsoleClient()
try
Context initial=new InitialContext();
Object objref=initial.lookup("java:comp/env/DisplayJNDI");
DisplayHome home=(DisplayHome)PortableRemoteObject.narrow(objref, DisplayHome.class);
Display ref=home.create();
System.out.println("Client Side: "+ref.display());
ref.remove();
catch(Exception ex)
System.out.println("Exception in Client Code: "+ex);
ex.printStackTrace();
public static void main(String args[])
new DisplayConsoleClient();
========== Console Client Class END ======
========== Servlet Client Class START ======
// The DisplayApp Servlet Client Class File
import javax.ejb.*;
import javax.rmi.*;
import javax.naming.*;
import Display;
import DisplayHome;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class DisplayServletClient extends HttpServlet
private PrintWriter out;
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
try
System.out.println("Servlet Entered");
response.setContentType("text/html");
System.out.println("HTML Content Type Set");
out=response.getWriter();
System.out.println("PrintWriter Object Created");
Context initial=new InitialContext();
System.out.println("Context Object Created");
Object objref=initial.lookup("java:comp/env/ejb/DisplayWEBJNDI");
System.out.println("Lookup Done Successfully");
DisplayHome home=(DisplayHome)PortableRemoteObject.narrow(objref, DisplayHome.class);
System.out.println("Home Object Created");
Display ref=home.create();
System.out.println("Remote Object Created");
out.println("<html><title>The Results Page</title>");
out.println("<body<hr>");
out.println("<h1>The Client Side Response is: ");
out.println(ref.display());
out.println("</h1>");
out.println("<hr>");
out.println("</body></html>");
System.out.println("Responses Done");
out.flush();
System.out.println("Output Stream Flushed");
ref.remove();
System.out.println("Remote Object Removed");
catch(Exception ex)
System.out.println("Exception in Servlet Client Code: "+ex);
ex.printStackTrace();
========== Servlet Client Class END ======
========== Calling HTML File START ======
<html>
<body>
<hr>
<form method="get" action="/servlet/DisplayServletClient">
<input type="submit" name="submit" value="Call Now!">
</form>
<hr>
</body>
</html>
========== Calling HTML File END ======
=========================================================
Since, the descriptors were automatically generated, I have not included them here. Also, I did not build the war, jar, ear files myself, they were automatically generated by the deploytool.
Please help!!
Thanks & Bye,
Tualha KhanHey,
This was the latest code snippet which I used in the Servlet file.
========================
try
System.out.println("Servlet Entered");
response.setContentType("text/html");
System.out.println("HTML Content Type Set");
out=response.getWriter();
System.out.println("PrintWriter Object Created");
InitialContext initial=new InitialContext();
System.out.println("Context Object Created");
Object objref=initial.lookup("DisplayWEBJNDI");
System.out.println("Lookup Done Successfully");
DisplayHome home=(DisplayHome)PortableRemoteObject.narrow(objref, DisplayHome.class);
System.out.println("Home Object Created");
Display ref=home.create();
System.out.println("Remote Object Created");
out.println("<html><title>The Results Page</title>");
out.println("<body<hr>");
out.println("<h1>The Client Side Response is: ");
out.println(ref.display());
out.println("</h1>");
out.println("<hr>");
out.println("</body></html>");
System.out.println("Responses Done");
out.flush();
System.out.println("Output Stream Flushed");
ref.remove();
System.out.println("Remote Object Removed");
========================
The Response was
========================
Servlet Entered
HTML Content Type Set
PrintWriter Object Created
Context Object Created
Exception in Servlet Client Code: javax.naming.NameNotFoundException: DisplayWEB
JNDI not found
javax.naming.NameNotFoundException: DisplayWEBJNDI not found
<<no stack trace available>>
========================
So what else should I do???
Thanks & Waiting,
Tualha Khan -
Communication between servlet(client behavior) and stand alone java program
Hello all:
I need to send a message (ascii characters sequence) from a servlet to a java program, but I'm not sure what is the best way to get it: socket, JMS or other mechanism that I don't know.
Is the servlet who is operating how client behavior.
Please, any comment will be appreciated, regards,
Ulises.You can always start a ServerSocket on the client (kinda sounds funny, doesn't it) which will accept connections. You then open a plain old Socket on the server to connect to the client's listener. (Note, this is the reverse of a normal set-up). Once you have the connection established, you will call getOutputStream() to get a stream to write to. Likewise, you will call getInputStream() to read the data sent. You will want to investigate the java.net.* and java.io.* libraries.
- Saish -
Servlet-client file serialization and Internet Explorer
I've written a servlet that serializes a multi-page tiff file to the requesting user-agent. The servlet works fine with Firefox and Netscape Navigator, opening a dialog to launch the default handler applicaton for the "image/tiff" MIME type, but Internet Explorer chokes on the output, popping up an error dialog that states the following:
Internet Explorer cannot download <icn>.tif from <hostname>
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
This is on top of a File Download dialog that shows the <icn>.tif being downloaded and a status of "Getting file information"
Here's my servlet code:
* Created on Apr 29, 2005
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
package eds.chico.ddm.web;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import eds.chico.ddm.interfaces.ClaimFinder;
import eds.chico.ddm.interfaces.ClaimFinderHome;
* Servlet Class
* @web.servlet name="ImgSerialize"
* display-name="ImgSerialize"
* description="ImgSerialize Servlet"
* @web.servlet-mapping url-pattern="/ImgSerialize"
* @web.servlet-init-param description="Buffer size used for io during image serialization"
* name="buffSize"
* value="512"
* @web.ejb-ref
* name="ejb/ClaimFinderHome"
* type="Session"
* home="eds.chico.ddm.interfaces.ClaimFinderHome"
* remote="eds.chico.ddm.interfaces.ClaimFinder"
* description="Reference to the ClaimFinder EJB"
* @jboss.ejb-ref-jndi
* ref-name = "ejb/ClaimFinderHome"
* jndi-name = "ejb/ClaimFinderHome"
public class ImgSerialize extends HttpServlet {
private static final long serialVersionUID = 1;
private ClaimFinderHome cfHome;
private ServletConfig cfg;
public ImgSerialize() {
super();
// TODO Auto-generated constructor stub
public void init(ServletConfig config) throws ServletException {
super.init(config);
this.cfg = config;
try {
Context ctx = new InitialContext();
cfHome = (ClaimFinderHome)ctx.lookup("java:comp/env/ejb/ClaimFinderHome");
} catch (NamingException e) {
throw new ServletException("EJB Lookup failed", e);
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException,
IOException {
processRequest(req, resp);
protected void doPost(
HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
private void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
String icn = req.getParameter("icn");
ClaimFinder cf = null;
String claimPath = null;
try {
cf = cfHome.create();
claimPath = cf.getClaimPath(icn);
cf.remove();
} catch (CreateException e) {
throw new ServletException("Unable to instantiate ClaimFinder EJB", e);
} catch (RemoteException e) {
throw new ServletException("ClaimFinder remote exception", e);
} catch (RemoveException e) {
// Hmmm... probably okay to do nothing
if (claimPath == null) {
throw new ServletException("claimPath is null after lookup");
File imageFile = new File(claimPath);
byte[] buff = new byte[new Integer(cfg.getInitParameter("buffSize"))];
try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(imageFile));
resp.setContentType("image/tiff");
BufferedOutputStream bos = new BufferedOutputStream(resp.getOutputStream());
while (bis.read(buff) != -1) {
bos.write(buff);
bis.close();
bos.close();
} catch (IOException e) {
throw new ServletException("java.io error", e);
}Unfortunately, the target users for this application will be using Internet Explorer, so I must find a way to make this code work with IE6. Anyone have any thoughts?
Greg Adams// assume you have an object representing a file, mine is not coming from disk, but from a blob in the database.
response.setContentLength( (int) file.getFileSize());
response.setHeader("Content-Type", ResponseUtil.getContentType(file.getFileName()));
// use inline or attachment depending upon whether you want the file to open within the browser,
// or in a separate window.
//response.setHeader("Content-Disposition","attachment; filename=\""+file.getFileName()+"\"");
response.setHeader("Content-Disposition","inline; filename=\""+file.getFileName()+"\"");
// Cache-control, some comments on different choices
//no cache header at all // works ok in IE and FireFox
//response.setHeader("Cache-control", "no-cache"); // works in FireFox, but not IE
response.setHeader("Cache-control", "must-revalidate"); // works in IE and FireFox
ServletOutputStream out = response.getOutputStream();
out.write(file.getFileBytes());
public static final String CONTENT_TYPE_GIF = "image/gif";
public static final String CONTENT_TYPE_JPG = "image/jpeg";
public static final String CONTENT_TYPE_TXT = "text/html";
public static final String CONTENT_TYPE_XML = "text/xml";
public static final String CONTENT_APPLICATION_OCTET_STREAM = "application/octet-stream";
* By setting the response content type, we are advising the user's agent (browser)
* which application to use to open the document, and whether or not the application
* will run within the browser.
* e.g., Our handling of xls files launches a dialog to open or save the xls file,
* and the excel application is run independent of the browser.
public static String getContentType(String filename)
String responseContentType = CONTENT_APPLICATION_OCTET_STREAM;
if (filename.toLowerCase().endsWith("html") || filename.toLowerCase().endsWith("htm"))
responseContentType = CONTENT_TYPE_TXT;
else if (filename.toLowerCase().endsWith("jpg") || filename.toLowerCase().endsWith("jpeg"))
responseContentType = CONTENT_TYPE_JPG;
else if (filename.toLowerCase().endsWith("gif"))
responseContentType = CONTENT_TYPE_GIF;
else if (filename.toLowerCase().endsWith("xml"))
responseContentType = CONTENT_TYPE_XML;
//TODO handle other file types
return responseContentType;
} -
Communication beween an http client a servlet and a socket server
Hello I’m developing an application that needs a client to communicate with a servlet using Http and then the servlet needs to connect to a server using sockets.
The client will send an image to the servlet and then the servlet will send that image to the server.
Everything works OK except when I try to send the data from the servlet to the server. It seems that there is no indication of when the outputstream has reached its end. So when trying to do this at the server side:
BufferedInputStream inFromClient =
new BufferedInputStream(serverSocket.getInputStream());
int inp=0;
while ( (inp=inFromClient.read())!=-1 )
//do smth
}The server will block at the read() method.
If I close the connection from the servlet using the close() method of a print stream everything will work fine
but I don't want to do that because I want the server to send a message back at the servlet.
I don't know if I make any sense but I'm new to servlets and Java as well.
Thanks in advance and if there something that you don't understand please let me know.I'm not quite sure what you mean. I have tried to do the same in the following piece of code and it worked fine. The only difference is that here the data is read from a file but I still send it as raw data(bytes).
import java.io.*;
import java.net.*;
public class Client
private String path="c:\\img0049.jpg";
private static void sendImage(Socket client,BufferedOutputStream toServer)
BufferedInputStream readFile=null;
int inp=0;
try
readFile = new BufferedInputStream( new FileInputStream(path) );
while ( (inp=readFile.read())!=-1 )
toServer.write(inp);
catch (IOException e)
e.printStackTrace();
finally
if (readFile != null)
try {
readFile.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//client.close();
public static void main(String args[]) throws Exception {
// connect through localhost to the same port that the server is listening to
Socket clientSocket = new Socket("127.0.0.1", 4322);
BufferedOutputStream outToServer =
new BufferedOutputStream(clientSocket.getOutputStream());
sendImage(clientSocket,outToServer);
outToServer.close();
clientSocket.close();
}// main
}// classIn the server side I'm just reading it with something like that
try {
BufferedOutputStream out =
new BufferedOutputStream( new FileOutputStream("c:\\out.jpg"));
int inp=0;
while ( (inp=inFromClient.read())!=-1 )
out.write(inp);
out.close(); //close will also flush
//.....rest of codeNow here is the servlet code of the application that I'm discussing (the servlet has already received the data from the client using the Htpp protocol. I know it has through debugging).
I'm guessing that the servlet is storing my data in the BufferedInputStream so then I'm trying to read from there and send it to the server
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
/* Get input stream from mobile client: Servlet<-- Client */
ServletInputStream inputFromClient = request.getInputStream();
BufferedInputStream bufInputFromClient = new BufferedInputStream(inputFromClient);
/*Create socket and get output stream in order to communicate with
* Server: Server<-- Servlet */
Socket clientSocket = new Socket("127.0.0.1",4322);
OutputStream outputToServer = new PrintStream(
clientSocket.getOutputStream());
/* Empty buffer and send data to output stream */
int inp=0;
while ( (inp=bufInputFromClient.read())!=-1 )
outputToServer.write(inp);
outputToServer.flush();
//outputToServer.close(); //If I use this the server will know that the stream has ended At the server I'm using again the 2nd piece of code I posted above.
That's it I hope I'm not confusing you.Thanks -
Problem in accessing a EJB bean through a servlet
Dear all,
I'm a trying to call a stateless session bean which has its home and component interfaces, which prints the name it receives from the servlet client.
I'm trying to access a remote server EJB beans, which has been registered with JNDI & when deploying the EJB beans onto the Jboss server which operates in localhost: 8081 it has shown
20:19:16,890 INFO [EjbModule] Deploying greetBean
20:19:17,109 INFO [ProxyFactory] Bound EJB Home 'greetBean' to jndi 'greetJndi'
20:19:17,125 INFO [EJBDeployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/deploy/greet.jarThis is my servlet which is there in tomcat container which runs in localhost:8082 to access the bean:
import java.net.*;
import javax.ejb.*;
import javax.rmi.*;
import java.rmi.*;
import javax.naming.*;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class greetServlet extends HttpServlet
public void doPost
(HttpServletRequest req, HttpServletResponse res)
throws ServletException,IOException
res.setContentType("text/html");
PrintWriter out=res.getWriter();
try
out.println("Inside servlet");
Properties props=new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
*props.put(Context.PROVIDER_URL, "localhost:8081");*
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
System.out.println("Properties ok");
Context ctx=new InitialContext(props);
System.out.println("context ok");
greetHome home = (greetHome)
ctx.lookup("greetJndi");
System.out.println("home ok");
greetRemote remote=home.create();
System.out.println("remote ok");
String a = req.getParameter("text1");
String s = remote.greetme(a);
System.out.println(s);
out.println(s);
catch(Exception e)
{System.out.println(""+e);}
}When i try to access the bean it's throwing a communication exception. The exact stack trace is:
javax.naming.CommunicationException: Could not obtain connection to any of these
urls: localhost:8081 and discovery failed with error: javax.naming.Communicatio
nException: Receive timed out [Root exception is java.net.SocketTimeoutException
: Receive timed out] [Root exception is javax.naming.CommunicationException: Fai
led to retrieve stub from server localhost:8081 [Root exception is java.io.EOFEx
ception]]Could anyone say why this is occuring and how this can be fixed.
Thanx in advance.when i change the properties url attribute to jnp://localhost:1099 like
props.put(Context.PROVIDER_URL, "jnp://localhost:1099");It's throwing unmarshall exception:
javax.naming.CommunicationException [Root exception is java.rmi.ServerException:
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.net.MalformedURLException: no protocol: Files/Apache]Could anyone throw light on this? -
Standalone Web Service clients in NetBeans with WSIT security
I'm having a problem create a secure app with NetBeans, any help would be appreciated, here's what I did:
Following the WSIT tutorial (http://java.sun.com/webservices/reference/tutorials/wsit/doc/index.html) I was able to create a Web Service with (for example) Username Authentication with Symmetric Key. I select the keystore as being the either the default development settings (I installed V3 certificates previously) or what I imagine are the same as them: keystore from domain1, alias xws-server and a username and password that I've created in the glassfish admin console. All good so far.
I then create a new web app servlet client, configuring the Web Service client with the corresponding cacerts keystore, alias xws-security-server from domain1 and the correct username and password. Deploy that and bingo, it works.
Try that again with a standalone Java client configuring the client reference in exactly the same way and using:
try { // Call Web Service Operation
uk.ac.ox.sddag.glassfish.server.SecureWSService service = new uk.ac.ox.sddag.glassfish.server.SecureWSService();
uk.ac.ox.sddag.glassfish.server.SecureWS port = service.getSecureWSPort();
int x = 1200;
int y = 36;
int result = port.add(x, y);
System.out.println("Result = "+result);
} catch (Exception ex) {
System.out.println("Exception:");
ex.printStackTrace();
}but this time, it doesn't work:
Exception:
javax.xml.ws.soap.SOAPFaultException: ERROR: No security header found in the message
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:188)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy29.add(Unknown Source)
at securestandaloneclient.Main.main(Main.java:26)
Caused by: javax.xml.ws.soap.SOAPFaultException: ERROR: No security header found in the message
at com.sun.xml.ws.security.opt.impl.util.SOAPUtil.getSOAPFaultException(SOAPUtil.java:171)
at com.sun.xml.wss.provider.wsit.WSITServerAuthContext.validateRequest(WSITServerAuthContext.java:277)
at com.sun.xml.wss.provider.wsit.WSITServerAuthContext.validateRequest(WSITServerAuthContext.java:179)
at com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:168)
at com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:176)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)I'm assuming that it's something to do with the WSDL being used to create the request, here's what the source view for the web service reference says:
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-417-SNAPSHOT. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-417-SNAPSHOT. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://server.glassfish.sddag.ox.ac.uk/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://server.glassfish.sddag.ox.ac.uk/" name="SecureWSService">
<ns1:Policy xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/policy" wsu:Id="SecureWSPortBindingPolicy">
<ns1:ExactlyOne>
<ns1:All>
<ns4:SignedSupportingTokens xmlns:ns4="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns4:UsernameToken ns4:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns4:WssUsernameToken10></ns4:WssUsernameToken10>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns4:UsernameToken>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns4:SignedSupportingTokens>
<ns5:SymmetricBinding xmlns:ns5="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns5:AlgorithmSuite>
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns5:Basic128></ns5:Basic128>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns5:AlgorithmSuite>
<ns5:IncludeTimestamp></ns5:IncludeTimestamp>
<ns5:Layout>
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns5:Strict></ns5:Strict>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns5:Layout>
<ns5:OnlySignEntireHeadersAndBody></ns5:OnlySignEntireHeadersAndBody>
<ns5:ProtectionToken>
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns5:X509Token ns5:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns5:RequireIssuerSerialReference></ns5:RequireIssuerSerialReference>
<ns5:WssX509V3Token10></ns5:WssX509V3Token10>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns5:X509Token>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns5:ProtectionToken>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns5:SymmetricBinding>
<ns6:Wss11 xmlns:ns6="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns1:Policy>
<ns1:ExactlyOne>
<ns1:All>
<ns6:MustSupportRefEncryptedKey></ns6:MustSupportRefEncryptedKey>
<ns6:MustSupportRefIssuerSerial></ns6:MustSupportRefIssuerSerial>
<ns6:MustSupportRefThumbprint></ns6:MustSupportRefThumbprint>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
</ns6:Wss11>
<ns7:UsingAddressing xmlns:ns7="http://www.w3.org/2006/05/addressing/wsdl" ns1:Optional="true"></ns7:UsingAddressing>
</ns1:All>
</ns1:ExactlyOne>
</ns1:Policy>
<ns8:Policy xmlns:ns8="http://schemas.xmlsoap.org/ws/2004/09/policy" wsu:Id="SecureWSPortBinding_add_Input_Policy">
<ns8:ExactlyOne>
<ns8:All>
<ns9:EncryptedParts xmlns:ns9="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns9:Body></ns9:Body>
</ns9:EncryptedParts>
<ns10:SignedParts xmlns:ns10="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns10:Body></ns10:Body>
<ns10:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header>
<ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"></ns10:Header>
<ns10:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header>
<ns10:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header>
<ns10:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header>
<ns10:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header>
<ns10:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="AckRequested"></ns10:Header>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="CreateSequence"></ns10:Header>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="Sequence"></ns10:Header>
<ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="SequenceAcknowledgement"></ns10:Header>
</ns10:SignedParts>
</ns8:All>
</ns8:ExactlyOne>
</ns8:Policy>
<ns11:Policy xmlns:ns11="http://schemas.xmlsoap.org/ws/2004/09/policy" wsu:Id="SecureWSPortBinding_add_Output_Policy">
<ns11:ExactlyOne>
<ns11:All>
<ns12:EncryptedParts xmlns:ns12="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns12:Body></ns12:Body>
</ns12:EncryptedParts>
<ns13:SignedParts xmlns:ns13="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<ns13:Body></ns13:Body>
<ns13:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"></ns13:Header>
<ns13:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"></ns13:Header>
<ns13:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"></ns13:Header>
<ns13:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"></ns13:Header>
<ns13:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"></ns13:Header>
<ns13:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"></ns13:Header>
<ns13:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"></ns13:Header>
<ns13:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="AckRequested"></ns13:Header>
<ns13:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="CreateSequence"></ns13:Header>
<ns13:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="Sequence"></ns13:Header>
<ns13:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm/policy" Name="SequenceAcknowledgement"></ns13:Header>
</ns13:SignedParts>
</ns11:All>
</ns11:ExactlyOne>
</ns11:Policy>
<types>
<xsd:schema>
<xsd:import namespace="http://server.glassfish.sddag.ox.ac.uk/" schemaLocation="http://localhost:8080/SecureApplication/SecureWSService?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="add">
<part name="parameters" element="tns:add"></part>
</message>
<message name="addResponse">
<part name="parameters" element="tns:addResponse"></part>
</message>
<portType name="SecureWS">
<operation name="add">
<input message="tns:add"></input>
<output message="tns:addResponse"></output>
</operation>
</portType>
<binding name="SecureWSPortBinding" type="tns:SecureWS">
<ns14:PolicyReference xmlns:ns14="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#SecureWSPortBindingPolicy"></ns14:PolicyReference>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<operation name="add">
<soap:operation soapAction="add"></soap:operation>
<input>
<ns15:PolicyReference xmlns:ns15="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#SecureWSPortBinding_add_Input_Policy"></ns15:PolicyReference>
<soap:body use="literal"></soap:body>
</input>
<output>
<ns16:PolicyReference xmlns:ns16="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#SecureWSPortBinding_add_Output_Policy"></ns16:PolicyReference>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="SecureWSService">
<port name="SecureWSPort" binding="tns:SecureWSPortBinding">
<soap:address location="http://localhost:8080/SecureApplication/SecureWSService"></soap:address>
</port>
</service>
</definitions>The contents of META-INF (The WSDL):
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-417-SNAPSHOT. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-417-SNAPSHOT. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://server.glassfish.sddag.ox.ac.uk/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://server.glassfish.sddag.ox.ac.uk/" name="SecureWSService" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:sc="http://schemas.sun.com/2006/03/wss/client" xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy">
<types>
<xsd:schema>
<xsd:import namespace="http://server.glassfish.sddag.ox.ac.uk/" schemaLocation="http://localhost:8080/SecureApplication/SecureWSService?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="add">
<part name="parameters" element="tns:add"></part>
</message>
<message name="addResponse">
<part name="parameters" element="tns:addResponse"></part>
</message>
<portType name="SecureWS">
<operation name="add">
<input message="tns:add"></input>
<output message="tns:addResponse"></output>
</operation>
</portType>
<binding name="SecureWSPortBinding" type="tns:SecureWS">
<wsp:PolicyReference URI="#SecureWSPortBindingPolicy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<operation name="add">
<soap:operation soapAction="add"></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="SecureWSService">
<port name="SecureWSPort" binding="tns:SecureWSPortBinding">
<soap:address location="http://localhost:8080/SecureApplication/SecureWSService"></soap:address>
</port>
</service>
<wsp:Policy wsu:Id="SecureWSPortBindingPolicy">
<wsp:ExactlyOne>
<wsp:All>
<sc:CallbackHandlerConfiguration wspp:visibility="private">
<sc:CallbackHandler default="example1" name="usernameHandler"/>
<sc:CallbackHandler default="password1" name="passwordHandler"/>
</sc:CallbackHandlerConfiguration>
<sc:TrustStore wspp:visibility="private" type="JKS" storepass="changeit" location="/Applications/NetBeans/glassfish-v2ur2/domains/domain1/config/cacerts.jks" peeralias="xws-security-server"/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</definitions>The wsit-client:
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="mainclientconfig"
>
<import location="SecureWSService.xml" namespace="http://server.glassfish.sddag.ox.ac.uk/"/>
</definitions>This bug still isn't fixed.
Thank you, adding Glassfish's webservices-rt.jar does fix it. -
RMI Server and RMI Client Problem
First, Hi!
I have create my RMI Server and a RMI Servlet client.
I can run the server and servlet first time and it works fine.
Then, I stop rmiregistry and server.
Then, I start rmiregistry and server for a second time but my RMI Servlet client gets a
java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx; nested exception is: java.net.ConnectException: Connection refused
If I copy the class again where the servlets resides, it works again. But I have to keep doing that. I have to keep copying the class file to the servlet directory every 2nd time I try to run it for it to work.
Anyone know what am I doing wrong?First, Hi!
I have create my RMI Server and a RMI Servlet client.
I can run the server and servlet first time and it
works fine.
Then, I stop rmiregistry and server.
Then, I start rmiregistry and server for a second time
but my RMI Servlet client gets a
java.rmi.ConnectException: Connection refused to host:
xxx.xxx.xxx.xxx; nested exception is:
java.net.ConnectException: Connection refused
If I copy the class again where the servlets resides,which class file ? u mean RMIServer's class files ??
I have faced the same problem too. In my case if i just restart my Tomcat webserver the error goes and the servlet is very well able to connect back to the RMI Server
it works again. But I have to keep doing that. I have
to keep copying the class file to the servlet
directory every 2nd time I try to run it for it to
work.
Anyone know what am I doing wrong? -
Standalone Web Service clients in NetBeans with Reliable Messaging
Following the WSIT tutorial (http://java.sun.com/webservices/reference/tutorials/wsit/doc/index.html) it's possible to create a Web Service with Reliable Messaging and a servlet client which run perfectly, great, but try and create a standalone client in NetBeans and it immediatly fails.
Basically I created a standard Java application, did New->Web Service Client exactly like I had done in the servlet example and then used the Web Service Client Resources -> Call Web Service Operation context menu to add a Web Service call to my java application.
The relevant code:
try { // Call Web Service Operation
uk.ac.ox.sddag.glassfish.server.NonSecureWSService service = new uk.ac.ox.sddag.glassfish.server.NonSecureWSService();
uk.ac.ox.sddag.glassfish.server.NonSecureWS port = service.getNonSecureWSPort();
int x = 0;
int y = 10;
int result = port.add(x, y);
System.out.println("Result = "+result);
((Closeable)port).close();
} catch (Exception ex) {
System.out.println("Exception:");
ex.printStackTrace();
}Result:
Exception:
javax.xml.ws.soap.SOAPFaultException: com.sun.xml.ws.rm.RMException: WSRM3018: Non RM Request or Missing wsa:Action header
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:188)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy29.add(Unknown Source)
at nonsecurestandaloneclient.Main.main(Main.java:29)
Caused by: javax.xml.ws.WebServiceException: com.sun.xml.ws.rm.RMException: WSRM3018: Non RM Request or Missing wsa:Action header
at com.sun.xml.ws.rm.jaxws.runtime.server.RMServerTube.processRequest(RMServerTube.java:343)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
at com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:218)
at com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:176)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: com.sun.xml.ws.rm.RMException: WSRM3018: Non RM Request or Missing wsa:Action header
at com.sun.xml.ws.rm.jaxws.runtime.server.RMServerTube.handleProtocolMessage(RMServerTube.java:469)
at com.sun.xml.ws.rm.jaxws.runtime.server.RMServerTube.processRequest(RMServerTube.java:145)
... 45 more
BUILD SUCCESSFUL (total time: 1 second)By removing the Reliable Messaging from the Web Service this error goes away. Initially I thought this error might be being caused by not specifying the WebMethod annotations 'action' parameter, but it's definitely set.
package uk.ac.ox.sddag.glassfish.server;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService()
public class NonSecureWS {
@WebMethod(action = "add")
public int add(@WebParam(name = "x") int x, @WebParam(name = "y") int y) {
return x+y;
}Interestingly, I found that this error also goes away if I add the library webservices-rt.jar from my glassfish libs to the project. Perhaps this is an oversight of NetBeans and should have been added automatically if reliable messaging is enabled, although by default it does have JAX-WS 2.1 jaxws-tools which I'm guessing is for some reason not adequate. JAX-WS version mismatch?This bug still isn't fixed.
Thank you, adding Glassfish's webservices-rt.jar does fix it. -
Websphere report 9i thin client
Hi,
I saw that the report 9i servlet client for BEA weblogic is out for download long time ago, but never see the Websphere servlet client. When is it avilable? So that I can send request to report 9i server directly from my Websphere web application.
Thanks.
Davidhi david,
we are currently working on the Reports J2EE Thin Client for IBM Websphere. The work should be finished within the next weeks. We will post a message in this forum once it is available.
Thanks for your interest.
Christian Hauser -
How to open gnome through servlet ?
Hi,
i am not able to open gnome-terminal with the help of the following servlet statement in the client side tomcat server in the servlet.while it working well on my tomcat server........is ther any permission to open the gnome...pl let me know
Statement..........................
Runtime rt=null;
Process p = rt.getRuntime().exec("gnome-terminal ");
Please do hurry ....Hi,
i am not able to open gnome-terminal with the help of
the following servlet statement in the client side
tomcat server in the servlet.Client-side tomcat server?
while it working well on
my tomcat server........is ther any permission to
open the gnome...pl let me know
Statement..........................
Runtime rt=null;
Process p = rt.getRuntime().exec("gnome-terminal ");
Please do hurry ....Are you wanting to write a servlet (something that executes on the server) to open up a shell on the Client? That's not gonna work. If you've an X Server on the client then just export your DISPLAY and start a remote X session.
Good Luck
Lee -
Problem invoking EJB from client
I'm using J2EE 1.4 to package this application
but I get an internal error when trying to call the servlet client
here are the codes for the stateless Bean
import java.util.*;
import java.io.*;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class LoanBean implements SessionBean
private javax.ejb.SessionContext m_ctx = null;
public void setSessionContext(SessionContext ctx)
m_ctx = ctx;
public void ejbCreate() throws java.rmi.RemoteException,javax.ejb.CreateException
System.out.println("ejbCreate() on obj" + this);
public void ejbRemove()
System.out.println("ejbRemove() on obj" + this);
public void ejbActivate()
System.out.println("ejbActivate() on obj" + this);
public void ejbPassivate()
System.out.println("ejbPassivate() on obj" + this);
public float calculateInterest(float rate, float time, float amount)throws java.rmi.RemoteException
float interest = time * amount * (rate/ 100);
return interest;
the code for the home interface
import javax.ejb.EJBHome;
public interface LoanHome extends EJBHome
public Loan create() throws java.rmi.RemoteException,javax.ejb.CreateException;
the code for the remote interface
import javax.ejb.EJBObject;
public interface Loan extends EJBObject
public float calculateInterest(float rate, float time, float amount)throws java.rmi.RemoteException;
and here is the code for my servlet client
import java.io.*;
import javax.servlet.*;
import javax.naming.*;
import javax.servlet.http.*;
import javax.rmi.PortableRemoteObject;
import javax.ejb.*;
public class LoanServlet extends HttpServlet
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
PrintWriter out = res.getWriter();
res.setContentType("text/html");
float rate = Float.valueOf(req.getParameter("rate")).floatValue();
float time = Float.valueOf(req.getParameter("time")).floatValue();
float amount = Float.valueOf(req.getParameter("amount")).floatValue();
Loan myLoanRemote = null;
LoanHome myLoanHome = null;
InitialContext initCon = null;
try
initCon = new InitialContext();
catch(Exception e)
out.println("First" + e.toString());
try
String JNDIName = "ejb/SimpleLoan";
Object obj = initCon.lookup(JNDIName);
myLoanHome = (LoanHome)PortableRemoteObject.narrow(obj, LoanHome.class);
catch(Exception e)
out.println("Second" + e.toString());
try
****myLoanRemote = myLoanHome.create();
catch(CreateException e)
out.println("Third" + e.toString());
float interest = myLoanRemote.calculateInterest(rate, time, amount);
out.println("<B> Interest : " + interest + " </B>");
I get an internal error that points to the line with **** (that is line 40)
help plstried it but got this error
java.lang.NullPointerException
at LoanServlet.doGet(LoanServlet.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:748)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:102)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:261)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:200)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:180)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:582)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:161)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:979)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:692)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:647)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:691)
at java.lang.Thread.run(Thread.java:534)
|#] -
Hi All,
I've a small deployment issue which you guys might be able to help me with.
I've developed an ADF BC JSF project using JHeadstart 10.1.3.2.50 and it was running fine on my self contained OC4J instance. But when I try to deploy it across to my Oracle 10G AS version 10.1.2.0.2., it had the following errors:
----- START OF LOG ------
Initializing log
Servlet interface for OC4J DCM commands
Command timeout defined at 600 seconds
Executing DCM command...
Executing command redeploy D:\OraHome_3 D:\jdevstudio10133\jdev\mywork\PAM2070C\ViewController\deploy\webapp1.ear webapp1 UNDEFINED
Command = REDEPLOY
Reading application's ear file
Ear file was successfully read
Opening connection to Oc4jDcmServlet
Setting userName to ias_admin
Sending command to DCM servlet
HTTP response code = 200, HTTP response msg = OK
Command was successfully sent to Oc4jDcmServlet
Receiving session id from servlet to check command status
Session id = c0a8238746b50fc1d5b78e274fcfb38b81a490036726
Please, wait for command to finish...
Checking command status...
Setting userName to ias_admin
Setting Cookie to JSESSIONID=c0a8238746b50fc1d5b78e274fcfb38b81a490036726
Checking command status
HTTP response code = 200, HTTP response msg = OK
Command has finished
Receiving command exit value
Receiving command output
**** No output was received from command
Closing connection to Oc4jDcmServlet
#### DCM command did not complete successfully (-8)
#### HTTP return code was -8
Exit status of DCM servlet client: -8
Elapsed time for deployment: 18 seconds
#### Deployment incomplete. #### 15/05/2008 17:00:33
---- END OF LOG ----
Has anyone been able to deploy ADF JSF project with JHeadstart using JDeveloper 10.1.3.3.0 to Oracle 10G AS 10.1.2.0.2? I'm using window environment. Any feedback is much appreciated. Thank you for your assistance and have a nice day.
Kind Regards,
JohnHi all,
I had also tried out something else...
I am now portalizing the ADF application using PortalFacesBridge and portlet.xml. Then I deploy it on the Local OC4J of my system and expose it as a WSRP Portlet using the url: 'http://hostname:portname/warFileName/info and generating a WSDL URL...
I am then using this WSDL URL to regester this portalized application on the Oracle Portal10.1.4 which i am able to accomplish successfully...
However after regestration, when I try to view this on the portal page, It is throwing the following error:-
Error: Could not get markup. The cookie or session is invalid or there is a runtime exception.
Also I would like to add that this method was working perfectly fine previously...
What might be the clue for this sudden error...
Any kind of help is greatly appriciated... Thanks...
Maybe you are looking for
-
Dowloaded 10.2.1.537 When I first loaded this it had a lot of trouble finding my Wifi again and would disengage. Problem went away after a few hours but it recurred this am. Also affected Facebook. Skype is loading more slowly and jumps to a black
-
<blockquote>Locking duplicate thread.<br> Please continue here: [/questions/782039]</blockquote><br> When trying to stream video I am getting this error message "Firefox doesn't know how to open this address, because the protocol (st) isn't associate
-
How to change my payment methode o none
My visa card is declined and i want to change my payment method to none ......without using another visa card cause i can't... i need help, thanks...
-
Hi All, I've one doubt regarding the bulk operations using the forall statement. Check below eample: CREATE TABLE emp_temp AS SELECT * FROM employees; DECLARE TYPE empid_tab IS TABLE OF employees.employee_id%TYPE; emp_sr empid_tab; -- create an excep
-
SOP : just Sales and cost planning .. possible?
Hello, I have a short question - could not find the answer here. Can you help? Is it possible to run SOP just from the perspective of looking at costing, in a budget for next year say? My client runs ECCP all modules except that we do not use MRP, ca