Client examples beside Java

Can anyone pls send me some link that teach me how to develop client web services.
I already using Java for writing all the services that will be provided for client. Now I want use other languages for write the client side application to invoke the web services so that I can showing that the web services can communication with different languages client application.
Thanks a lot.

Go on MSDN, it's full of examples!

Similar Messages

  • Socket example using Java 5

    Last year I posted 4 programs that provided a simple client server using both stream sockets and NIO. I decided as an exercise in using Java 5 to port that code and try to use as many of the new features as possible. The following code is very long and does what all the previous example programs did. In replies do not repost the whole of this message.
    It provides a simple chat like client and server. The user can request either a stream connection or a NIO connection or provide one of their own.
    //========================== MsgSwitch.java ===========================//
    package pkwnet.msgswitch;
    import java.util.logging.Logger;
    import java.util.logging.Level;
    import java.util.logging.Handler;
    * main class for message switch
    * command line arguments are
    * -p port number for server
    * -s run server
    * -a server ip address including port for client
    * -i idle timer in seconds
    * -n use NIO
    * -c specify connection class
    public class MsgSwitch {
        static private int errors = 0;
        static private String address = "127.0.0.1:6060";
        static private String connectionClass = "pkwnet.msgswitch.StreamConnection";
        static public void main(String [] args) {
            int port = 6060;
            int idleTime = 600;
            boolean server = false;
            boolean nio = false;
            Logger logger = Logger.getLogger("msgswitch");
            for(String arg : args) {
                if(arg.startsWith("-a")) {
                    address = arg.substring(2);
                } else if(arg.startsWith("-p")) {
                    port = argToInt(arg);
                    server = true;
                } else if(arg.startsWith("-i")) {
                    idleTime = argToInt(arg);
                } else if (arg.startsWith("-s")) {
                    server = true;
                } else if (arg.startsWith("-c")) {
                    connectionClass = arg.substring(2);
                } else if (arg.startsWith("-n")) {
                    connectionClass = "pkwnet.msgswitch.NIOConnection";
                } else {
                    String err = "unknown argument=" + arg;
                    logger.severe(err);
                    System.err.println(err);
                    errors++;
            if (errors == 0) {
                if (server) {
                    new Server().listen(port,idleTime, nio);
                } else {
                    new Client().start(address, nio);
            } else {
                fail(errors + " errors encountered", null);
        static private int argToInt(String arg) {
            int val = 0;
            try {
                val = Integer.parseInt(arg.substring(2));
            } catch (NumberFormatException e) {
                String err = "invalid argument format: " + arg;
                Logger.getLogger("msgswitch").severe(err);
                System.err.println(err);
                errors++;
            return val;
        static public void fail(String err, Throwable e) {
            String msg = "Operation terminated: " + err;
            Logger.getLogger("msgswitch").log(Level.SEVERE, msg, e);
            System.err.println(msg);
            System.exit(12);
        static public Connection getConnection() {
            Connection conn = null;
            try {
                conn = (Connection) Class.forName(connectionClass).newInstance();
            } catch (Exception e) {
                fail ("connection class error", e);
            return conn;
        static public void logCaller(Logger logger, Level level) {
            String text = "CALLED";
            if (logger.isLoggable(level)) {
                try {
                    throw new Exception("logging stack");
                } catch (Exception e) {
                    StackTraceElement [] st = e.getStackTrace();
                    if (st.length > 1) {
                        text += formatElement(st[1]);
                    if (st.length >2) {
                        text += formatElement(st[2]);
                logger.log(level, text);
        static private String formatElement(StackTraceElement ste) {
            return "\n    " + ste.getClassName() + "." + ste.getMethodName()
                + "(" + ste.getFileName() + ":" + ste.getLineNumber() + ")";
    //================= Client.java =============================================//
    package pkwnet.msgswitch;
    * a simple Swing chat GUI using Java 5 and sockets.
    * @author PKWooster
    * @version 1.0 August 31,2005
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JMenu;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JDialog;
    import javax.swing.SwingUtilities;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.BorderLayout;
    import static java.awt.BorderLayout.*;
    client GUI class
    public class Client extends JFrame implements ConnectionListener {
         // swing GUI components
         private JTextField userText = new JTextField(40);
         private JTextArea sessionLog = new JTextArea(24,40);
         private JTextField statusText = new JTextField(40);
         private JPanel outPanel = new JPanel();
         private JScrollPane sessionLogScroll = new JScrollPane(sessionLog);
         private JMenuBar menuBar = new JMenuBar();
         private JMenuItem startItem = new JMenuItem("Start");
         private JMenuItem hostItem = new JMenuItem("Host");
         private JMenuItem aboutItem = new JMenuItem("About");
         private JMenuItem abortItem = new JMenuItem("Abort");
         private JMenuItem exitItem = new JMenuItem("Exit");
         private JMenu fileMenu = new JMenu("File");
         private JMenu helpMenu = new JMenu("Help");
         private Container cp;
         private String address;
        private Connection connection;
        private boolean sendReady = false;
        private boolean nio = false;
         Client() {
        public void start(String address, boolean nio) {
            this.address = address;
            this.nio = nio;
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    runClient();
        private void runClient() {   
            connection = MsgSwitch.getConnection();
            connection.addConnectionListener(this);
              buildMenu();
              cp = getContentPane();
              sessionLog.setEditable(false);
              outPanel.add(new JLabel("Send: "));
              outPanel.add(userText);
              // enter on userText causes transmit
              userText.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){userTyped(evt);}
              cp.setLayout(new BorderLayout());
              cp.add(outPanel,NORTH);
              cp.add(sessionLogScroll,CENTER);
              cp.add(statusText,SOUTH);
              setStatus("Closed");
              addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent evt) {
                    mnuExit();
              pack();
            setVisible(true);
    * attempt to send the contents of the user text field
        private void userTyped(ActionEvent evt) {
            if (sendReady) {
                String txt = evt.getActionCommand()+"\n";
                userText.setText("");
                toSessionLog("> ", txt);
                sendReady = false;
                connection.send(txt);
    * append text to the session log
         private void toSessionLog(String prefix, String txt) {
              sessionLog.append(prefix + txt);
              sessionLog.setCaretPosition(sessionLog.getDocument().getLength() ); // force last line visible
    * build the standard menu bar
         private void buildMenu()
              JMenuItem item;
              // file menu
              startItem.addActionListener(new ActionListener()
              {public void actionPerformed(ActionEvent e){mnuStart();}});
              fileMenu.add(startItem);
              hostItem.addActionListener(new ActionListener()
              {public void actionPerformed(ActionEvent e){mnuHost();}});
              fileMenu.add(hostItem);
              exitItem.addActionListener(new ActionListener()
              {public void actionPerformed(ActionEvent e){mnuExit();}});
              fileMenu.add(exitItem);
              menuBar.add(fileMenu);
              helpMenu.add(aboutItem);
              aboutItem.addActionListener(new ActionListener()
              {public void actionPerformed(ActionEvent e){mnuAbout();}});
              menuBar.add(helpMenu);
              setJMenuBar(menuBar);
    * start and stop communications from start menu
         private void mnuStart() {
            if(connection.getState() ==  Connection.State.CLOSED) {
                connection.connect(address);
            } else {
                connection.disconnect();
    *  prompt user for host in form address:port
        private void mnuHost() {
              String txt = JOptionPane.showInputDialog("Enter host address:port", connection.getAddress());
              if (txt == null)return;
            address = txt;
         private void mnuAbout() {
              JDialog dialog = new JDialog(this, "About Client");
              JTextField text = new JTextField("Simple character client");
            dialog.getContentPane().add(text);
            dialog.pack();
            dialog.setVisible(true);
         // exit menu
         private void mnuExit() {
            exit();
        private void exit() {
              connection.disconnect();
              System.exit(0);
         private void setStatus(String st) {
            statusText.setText(st);
         private void setStatus(Connection.State state) {
            switch(state) {
                case OPENED:
                    startItem.setText("Stop");
                    setStatus("Connected to "+address);
                    break;
                case CLOSED:
                    startItem.setText("Start");
                    setStatus("Disconnected");
                    break;
                case OPENING:
                    setStatus("Connecting to "+address);
                    startItem.setText("Abort");
                    break;
                case CLOSING:
                    setStatus("Disconnecting from "+address);
                    startItem.setText("Abort");
                    break;
        public void stateChanged(final ConnectionEvent event) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    setStatus(event.getState());
        public void dataAvailable(final ConnectionEvent event) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    setStatus(event.getState());
                    String txt = event.getData();
                    if (txt == null) {
                        txt = "$null$";
                    toSessionLog("< ", txt + "\n");   
        public void sendAllowed(final ConnectionEvent event) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    setStatus(event.getState());
                    sendReady = true;
        public void accept(ConnectionEvent event) {
    //========================== Server.java ===============================//
    package pkwnet.msgswitch;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.concurrent.ConcurrentHashMap;
    * a simple message switch using stream based socket i/o
    * a very simple text message switching program
    * user commands start with $ and consist of blank seperated arguments
    * other lines sent by the user are forwarded
    * $on nickname targets
    *    sign on as nickname, sending to targets
    * $to targets
    *    change target list, reports current value
    * $list nicknames
    *    list status of specified nicknames
    * $list
    *    list all connected users
    * $off
    *    sign off
    * @author PKWooster
    * @version 1.0 September 1, 2005
    public class Server {
        private ConcurrentHashMap<String, User> perUser = new ConcurrentHashMap<String,User>();
        private Timer idleTimer;
        private Connection conn;
        public void listen(int port, final int idleTime, boolean nio) {
            idleTimer = new Timer();
            idleTimer.scheduleAtFixedRate(new TimerTask(){public void run(){oneSec();}},0,1000);
            conn = MsgSwitch.getConnection();
            conn.addConnectionListener(new ConnectionListener() {
                public void stateChanged(ConnectionEvent event) {
                public void dataAvailable(ConnectionEvent event) {
                public void sendAllowed(ConnectionEvent event) {
                public void accept(ConnectionEvent event) {
                    Connection uconn = event.getConnection();
                    new User(uconn, perUser, idleTime);
            conn.listen(port);
            idleTimer.cancel();
        private void oneSec() {
            Collection<User> uc = perUser.values();
            for(User u : uc) {
                u.oneSec();
    //================= User.java  ==============================================//
    package pkwnet.msgswitch;
    import java.io.*;
    import java.util.*;
    import java.util.concurrent.ConcurrentHashMap;
    import java.util.concurrent.atomic.AtomicInteger;
    import java.util.logging.Logger;
    import java.util.logging.Level;
    * defines the processing for a message switch user
    * @author PKWooster
    * @version 1.0 June 15,2004
    public class User implements ConnectionListener {
        private ConcurrentHashMap<String, User> perUser;
        private String name;
        private String address;
        private boolean signedOn = false;
        private String[] targets;
        private AtomicInteger remainingTime;
        private int idleTime;
        Connection conn;
        Logger logger;
      * construct a user, link it to its connection and put it in the perUser table
        User(Connection conn, ConcurrentHashMap<String,User>p, int idle) {
            this.conn = conn;
            logger = Logger.getLogger("msgswitch.user");
            conn.addConnectionListener(this);
            address = conn.getAddress();
            logger.info("creating user " + address);
            perUser = p;
            idleTime = idle;
            remainingTime = new AtomicInteger(idleTime);
            rename(address);
            targets = new String[0];
    * process state changes
        public void stateChanged(ConnectionEvent event) {
            if(event.getState() == Connection.State.CLOSED) {
                close(false);
    * data is available, process commands and forward other data.
        public void dataAvailable(ConnectionEvent event) {
            String msg = event.getData();
            if (msg.startsWith("$")) {
                doCommand(msg);
            } else {
                forward(msg);
            remainingTime.set(idleTime);
    * do nothing for sendAllowed events
        public void sendAllowed(ConnectionEvent event) {
    * do nothing for accept events
        public void accept(ConnectionEvent event) {
    * called once per second by the server main thread.
        public void oneSec() {
            if(idleTime != 0 && 1 > remainingTime.decrementAndGet()) {
                close(true);
    * send a message
        private void send(String msg) {
            conn.send(msg);
            remainingTime.set(idleTime);
    * forward data messages to other users
    * @param txt the message to send
        private void forward(String txt) {
            txt = name+": "+txt + "\n";
            if(0 < targets.length) {
                for(String target :targets) {
                    User user = perUser.get(target);
                    if(user != null) {
                        user.send(txt);
            } else {
                for (User user : perUser.values()) {
                    if (user != this) {
                        user.send(txt);
    * execute command messages, commands start with a $
    * and contain arguments delimited by white space.
    * @param command the command string
        private void doCommand(String command) {
            boolean good = false;
            command = command.substring(1).trim();
            if(command.length() > 0) {
                String [] args = command.split("\\s+");
                if(args[0].equals("on")) {
                    good = signOn(args);
                } else if(args[0].equals("off")) {
                    good = signOff(args);
                } else if(args[0].equals("list")) {
                    good = listUsers(args);
                } else if(args[0].equals("to")) {
                    good = setTargets(args,1);
                } else if(args[0].equals("idle")) {
                    good = setIdle(args);
                if(!good) {
                    send("invalid command=" + command + "\n");
    * sign on command
        private boolean signOn(String [] args) {
            boolean good = false;
            if(args.length >1) {
                String nm = args[1];
                logger.info("signing on as: " + nm);
                if(rename(nm)) {
                    conn.setName(name);
                    send("Signed on as " + name + "\n");
                    signedOn = true;
                    good = true;
                    setTargets(args,2);
                } else {
                    send("name="+nm+" already signed on\n");
            return good;
    * set forwarding targets
        private boolean setTargets(String [] args, int start) {
            if(start < args.length) {
                targets = new String[args.length-start];
                System.arraycopy(args, start, targets, 0, targets.length);
            String str = "to=";
            for(String target : targets) {
                str += (target + " ");
            send(str+"\n");
            return true;
    * set idle timeout
        private boolean setIdle(String[] args) {
            try {
                idleTime = new Integer(args[1]).intValue();
                remainingTime.set(idleTime);
                send("idle time set to "+idleTime+"\r\n");
                return true;
            } catch(NumberFormatException exc) {
                return false;
    * sign off
        private boolean signOff(String [] args) {
            close(true);
            return true;
    * list connected users
        private boolean listUsers(String [] args) {
            TreeSet<String> allUsers = new TreeSet<String>(perUser.keySet());
            HashSet<String> t = new HashSet<String>(Arrays.asList(targets));
            LinkedList<String> users;
            String response = "On,Target,Nickname\n";
            if(args.length < 2) {
                users = new LinkedList<String>(allUsers);
            } else {
                users = new LinkedList<String>();
                for (int i = 1; i < args.length; i++) {
                    users.add(args);
    for(String username : users) {
    if(username.equals(name)) {
    response += "*,";
    } else {
    response += (allUsers.contains(username) ? "y," : "n,");
    response += (t.contains(username) ? "y," : "n,");
    response += (username + "\n");
    send(response);
    return true;
    * rename this user, first we attempt to add the new name then we remove
    * the old one. Both names will be registered for a short while.
    * @param newname the new name for this user
    * @return true if the rename was successful
    private boolean rename(String newname) {
    boolean b = false;
    logger.info("rename name="+name+" newname="+newname);
    if (name != null && name.equals(newname)) {
    b = true;
    } else if (null == perUser.putIfAbsent(newname, this)) {
    if (name != null) {
    perUser.remove(name);
    name = newname;
    b = true;
    return b;
    * delete from perUser and close our connection
    private void close(boolean disconnect) {
    logger.info("closing user "+name);
    perUser.remove(name);
    if (disconnect) {
    conn.disconnect();
    //====================== Connection.java ===============================//
    package pkwnet.msgswitch;
    import java.util.HashSet;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.logging.Logger;
    import java.util.logging.Level;
    public abstract class Connection {
    public enum State {CLOSED, OPENING, OPENED, CLOSING}
    private HashSet<ConnectionListener> listeners = new HashSet<ConnectionListener>();
    private State state = State.CLOSED;
    private String host = "127.0.0.1";
    private int port = 6060;
    private String name = "unconnected";
    public Connection() {
    public abstract void listen(int port);
    public abstract void connect(String address);
    public abstract void disconnect();
    public abstract void send(String message);
    public void addConnectionListener(ConnectionListener listener) {
    listeners.add(listener);
    public void removeConnectionListener(ConnectionListener listener) {
    listeners.remove(listener);
    protected void fireDataAvailable(String data) {
    for (ConnectionListener listener : listeners) {
    listener.dataAvailable(new ConnectionEvent(this, state, data));
    private void fireStateChanged() {
    for (ConnectionListener listener : listeners) {
    listener.stateChanged(new ConnectionEvent(this, state));
    protected void fireSendAllowed() {
    for (ConnectionListener listener : listeners) {
    listener.sendAllowed(new ConnectionEvent(this, state));
    protected void fireAccept(Connection conn) {
    for (ConnectionListener listener : listeners) {
    listener.accept(new ConnectionEvent(this, conn));
    protected void setState(State state) {
    if (this.state != state) {
    this.state = state;
    fireStateChanged();
    public State getState() {
    return state;
    protected void setAddress(String address) {
              int n = address.indexOf(':');
              String pt = null;
    setName(address);
    if(n == 0) {
                   host = "127.0.0.1";
                   pt = address.substring(1);
              else if(n < 0) {
                   host = address;
                   port = 5050;
              } else {
    host = address.substring(0,n);
                   pt = address.substring(n+1);
    if (pt != null) {
    try {
    port = Integer.parseInt(pt);
    } catch (NumberFormatException e) {
    port = -1;
    public String getName() {
    return name;
    public void setName(String value) {
    name = value;
    public String getAddress() {
    return host + ":" + port;
    public String getHost() {
    return host;
    public void setPort(int value) {
    port = value;
    public int getPort() {
    return port;
    //=================== ConnectionEvent.java ================================//
    package pkwnet.msgswitch;
    public class ConnectionEvent extends java.util.EventObject {
    private final String data;
    private final Connection.State state;
    private final Connection conn;
    public ConnectionEvent(Object source, Connection.State state, String data, Connection conn) {
    super(source);
    this.state = state;
    this.data = data;
    this.conn = conn;
    public ConnectionEvent(Object source, Connection.State state, String data) {
    this(source, state, data, null);
    public ConnectionEvent(Object source, Connection.State state) {
    this(source, state, null, null);
    public ConnectionEvent(Object source, Connection conn) {
    this(source, conn.getState(), null, conn);
    public Connection.State getState() {
    return state;
    public String getData() {
    return data;
    public Connection getConnection() {
    return conn;
    //============================ ConnectionListener.java ===================//
    package pkwnet.msgswitch;
    public interface ConnectionListener extends java.util.EventListener {
    public void stateChanged(ConnectionEvent event);
    public void dataAvailable(ConnectionEvent event);
    public void sendAllowed(ConnectionEvent event);
    public void accept(ConnectionEvent event);
    //============================ StreamConnection.java ===================//
    package pkwnet.msgswitch;
    import java.net.Socket;
    import java.net.ServerSocket;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.IOException;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.logging.Logger;
    import java.util.logging.Level;
    * provides stream socket i/o of character strings
    * @author PKWooster
    * @version 1.0 September 1, 2005
    public class StreamConnection extends Connection {
    private Socket sock;
    private BufferedReader in;
    private BufferedWriter out;
    private Thread recvThread = null;
    private Thread sendThread = null;
    protected LinkedBlockingQueue<String> sendQ;
    Logger logger;
    public StreamConnection() {
    super();
    logger = Logger.getLogger("msgswitch.stream");
    sendQ = new LinkedBlockingQueue<String>();
    * open a socket and start i/o threads
    public void connect(String ipAddress) {
    setAddress(ipAddress);
    try {
    sock = new Socket(getHost(), getPort());
    connect(sock);
    } catch (IOException e) {
    logger.log(Level.SEVERE, "Connection failed to=" + ipAddress, e);
    private void connect(Socket sock) {
    this.sock = sock;
    String ipAddress = getAddress();
    try {
    in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
    out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream()));
    recvThread = new Thread(new Runnable() {
    public void run() {
    doRecv();
    },"Recv." + getName());
    sendThread = new Thread(new Runnable() {
    public void run() {
    doSend();
    },"Send."+getName());
    sendThread.start();
    recvThread.start();
    setState(State.OPENED);
    } catch(IOException e) {
    logger.log(Level.SEVERE, "Connection failed to="+ipAddress, e);
    public void listen(int port) {       
    StreamConnection sconn;
    setPort(port);
    try {
    ServerSocket ss = new ServerSocket(port);
    while(true) {
    Socket us = ss.accept();
    sconn = new StreamConnection();
    String ipAddress = us.getInetAddress() + ":" + us.getPort();
    sconn.setAddress(ipAddress);
    sconn.connect(us);
    fireAccept(sconn);
    } catch(Exception e) {
    logger.log(Level.SEVERE, "listen failed", e);
    * close the socket connection
    public void disconnect() {
    logger.fine("disconnect sock=" + sock + " state="+ getState());
    if(getState() == State.OPENED) {
    setState(State.CLOSING);
    try {
    sock.shutdownOutput();
    } catch(IOException ie) {
    logger.log(Level.SEVERE, "showdown failed", ie);
    } else if(getState() != State.CLOSED) {
    try {
    sock.close();
    } catch(Exception e) {
    logger.log(Level.SEVERE, "close failed", e);
    if (sendThread.isAlive()) {
    sendThread.interrupt();
    sendQ.clear();
    setState(State.CLOSED);
    public void send(String message) {
    if (getState() == State.OPENED) {
    try {
    sendQ.put(message);
    } catch(InterruptedException e) {
    logger.log(Level.SEVERE, "sendQ put interrupted", e);
    setState(State.CLOSING);
    disconnect();
    * sets the public name of this connection
    public void setName(String name) {
    super.setName(name);
    if (sendThread != null) {
    try {
    recvThread.setName("recv." + name);
    sendThread.setName("send." + name);
    } catch(Exception e) {
    logger.log(Level.SEVERE, "nameing threads failed", e);
    * the main loop for the send thread
    private void doSend() {
    String msg;
    boolean running = true;
    while (running) {
    if (sendQ.size() == 0) {
    fireSendAllowed();
    try {
    msg = sendQ.take();
    out.write(msg);
    out.flush();
    } catch(Exception e) {
    if (getState() == State.OPENED) {
    logger.log(Level.SEVERE, "write failed", e);
    setState(State.CLOSING);
    disconnect();
    running = false;
    * the main loop for the receive thread
    private void doRecv() {
    String inbuf;
    while (getState() == State.OPENED) {
    try {
    inbuf = in.readLine();
    } catch(Exception e) {
    if (getState() == State.OPENED) {
    logger.log(Level.SEVERE, "readline failed", e);
    inbuf = null;
    if(inbuf == null) {
    logger.fine("null received on: " + getAdd

    Here are three of them:
    NIO server
    NIO client
    Multithreaded server
    The stream based client example seems to have been deleted, probably lost in the troll wars. I also posted a new Simple multithreaded server that uses the same protocol. As the client is missing, I'll repost it.

  • (DII) Client Example - - missing class error

    To jump into DII, I have copied the source for the "Dynamic Invocation Interface (DII) Client Example" into a new class created in netbeans. The api jar for JAX-RPC has been mounted in the environment. The example compiles fine, but upon execute the following error comes up:
    javax.xml.rpc.ServiceException: java.lang.ClassNotFoundException: com.sun.xml.rpc.client.ServiceFactoryImpl
    at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:65)
    at node.HelloClient.main(HelloClient.java:29)
    Do I need to get another api here? Looking into the jax-rpc jar file I can see the javax.xml.rpc.ServiceFactory class, but can not see com.sun.xml.rpc.client.ServiceFactoryImpl .
    Could someone point me to an answer? Thanks in advance for the help.

    The jaxrpc jar that I downloaded was from under the xml downloads (jaxrpc-1_0-fr-api-class.zip). Once extracted this gave me a jar file of jaxrpc-api.jar.
    It seems that you might be using a different jar? (jaxrpc-ri.jar)?
    Under my downloaded jar file, there is no client belwo the heirarchy of javax/xml/rpc . Where could I find the download for the jar file that you are refrencing?
    Thank you for your help.
    R

  • Can not build the client example of the webservices/rpc-example

    Hi!
    I have some problems with building the client example of the webservices rpc example.
    I followed the instructions of the readme and was able to build the weatherejb,
    after I saved the client.jar in %WL_HOME%\samples\examples\webservices\rpc\javaClient
    I put the cleint.jar into the classpath of the setExamplesEnv.cmd:
    set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%WL_HOME%\lib\xmlx.jar;%WL_HOME%\samples\eval\cloudscape\lib\cloudscape.jar;%WL_HOME%\samples\examples\webservices\rpc\javaClient\client.jar;%CLIENT_CLASSES%;%SERVER_CLASSES%;%EX_WEBAPP_CLASSES%;C:\bea
    but if I now change to
    $ cd %WL_HOME%\samples\examples\webservices\rpc\javaClient
    and try to build the ear -files by typing:
    ant
    I get the message:
    C:\bea\samples\examples\webservices\rpc\javaClient>ant
    Buildfile: build.xml
    compile:
    [javac] Compiling 3 source files to C:\bea\config\examples\clientclasses
    [javac] C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:8:
    ca
    nnot resolve symbol
    [javac] symbol : class Weather
    [javac] location: package weatherEJB
    [javac] import examples.webservices.rpc.weatherEJB.Weather;
    [javac] ^
    [javac] C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:28:
    c
    annot resolve symbol
    [javac] symbol : class Weather
    [javac] location: class examples.webservices.rpc.javaClient.Client
    [javac] Weather.class.getName() );
    [javac] ^
    [javac] C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:34:
    c
    annot resolve symbol
    [javac] symbol : class Weather
    [javac] location: class examples.webservices.rpc.javaClient.Client
    [javac] Weather service = (Weather)context.lookup("http://localhost:7001
    /weather/statelessSession.WeatherHome/statelessSession.WeatherHome.wsdl");
    [javac] ^
    [javac] C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:34:
    c
    annot resolve symbol
    [javac] symbol : class Weather
    [javac] location: class examples.webservices.rpc.javaClient.Client
    [javac] Weather service = (Weather)context.lookup("http://localhost:7001
    /weather/statelessSession.WeatherHome/statelessSession.WeatherHome.wsdl");
    [javac] ^
    [javac] 4 errors
    BUILD FAILED
    C:\bea\samples\examples\webservices\rpc\javaClient\build.xml:13: Compile failed,
    messages should have been provided.
    Total time: 3 seconds
    thanx

    Well, Remember(you might have done this) u have to run the
    setExamplesEnv.cmd after u add the client.jar in the classpath. Also, the
    ant command will work only in the window where u ran the setExamplesEnv.cmd.
    Thats what i didnt and it works perfect for me.
    Hope this helps u.
    Regards
    Elangovan
    Naz wrote in message <[email protected]>...
    >
    Hi!
    I have some problems with building the client example of the webservicesrpc example.
    I followed the instructions of the readme and was able to build theweatherejb,
    after I saved the client.jar in%WL_HOME%\samples\examples\webservices\rpc\javaClient
    I put the cleint.jar into the classpath of the setExamplesEnv.cmd:
    setCLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\
    lib\weblogic.jar;%WL_HOME%\lib\xmlx.jar;%WL_HOME%\samples\eval\cloudscape\li
    b\cloudscape.jar;%WL_HOME%\samples\examples\webservices\rpc\javaClient\clien
    t.jar;%CLIENT_CLASSES%;%SERVER_CLASSES%;%EX_WEBAPP_CLASSES%;C:\bea
    >
    but if I now change to
    $ cd %WL_HOME%\samples\examples\webservices\rpc\javaClient
    and try to build the ear -files by typing:
    ant
    I get the message:
    C:\bea\samples\examples\webservices\rpc\javaClient>ant
    Buildfile: build.xml
    compile:
    [javac] Compiling 3 source files toC:\bea\config\examples\clientclasses
    [javac]C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:8:
    ca
    nnot resolve symbol
    [javac] symbol : class Weather
    [javac] location: package weatherEJB
    [javac] import examples.webservices.rpc.weatherEJB.Weather;
    [javac] ^
    [javac]C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:28:
    c
    annot resolve symbol
    [javac] symbol : class Weather
    [javac] location: class examples.webservices.rpc.javaClient.Client
    [javac] Weather.class.getName() );
    [javac] ^
    [javac]C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:34:
    c
    annot resolve symbol
    [javac] symbol : class Weather
    [javac] location: class examples.webservices.rpc.javaClient.Client
    [javac] Weather service =(Weather)context.lookup("http://localhost:7001
    /weather/statelessSession.WeatherHome/statelessSession.WeatherHome.wsdl");
    [javac] ^
    [javac]C:\bea\samples\examples\webservices\rpc\javaClient\Client.java:34:
    c
    annot resolve symbol
    [javac] symbol : class Weather
    [javac] location: class examples.webservices.rpc.javaClient.Client
    [javac] Weather service =(Weather)context.lookup("http://localhost:7001
    /weather/statelessSession.WeatherHome/statelessSession.WeatherHome.wsdl");
    [javac] ^
    [javac] 4 errors
    BUILD FAILED
    C:\bea\samples\examples\webservices\rpc\javaClient\build.xml:13: Compilefailed,
    messages should have been provided.
    Total time: 3 seconds
    thanx

  • Storing chinese in client odb from java application

    Hi all,
    first i like to thank Greg Rekounas for his wonderful support and contribution....
    This is my server setup.
    os-windows 2000 sp4
    db-oracle 9ir2 (unicode with AL32UTF8 charset)
    lite-oracle10g r2 (with latest patchset)
    nls_lang- AMERICAN_AMERICA.AL32UTF8
    storing and retriving chinese in oracle 9i database from isql*plus works.
    lite configuration.
    1. In $OLITE_HOME\mobile_oc4j\j2ee\mobileserver\applications
    \mobileserver\setup\common\webtogo\webtogo.ora file edited the JAVA_OPTION
    to:
    JAVA_OPTION=-Djava.compiler=NONE -Dfile.encoding=UTF8
    2. In $OLITE_HOME\mobile_oc4j\j2ee\mobileserver\applications
    \mobileserver\setup\dmc\common\win32.inf file, added the following:
    a. In the <file> section, added the following:
    <item>
    <src>/common/win32/olilUTF8.dll</src>
    <des>$APP_DIR$\bin\olilUTF8.dll</des>
    </item>
    b. In the <ini> section, added the following:
    <item name='POLITE.INI' section='All Databases'>
    <item name="DB_CHAR_ENCODING">UTF8</item>
    </item>
    <item name='POLITE.INI' section='SYNC'>
    <item name="DB_ENCODING">UTF8</item>
    </item>
    published the application developed in java using packaging wizard.
    downloaded the client in the pc with the following config:
    windows 2000 (english)
    nls - default.
    installed chinese language support.
    tried to access 9i database from isql*plus and stored & viewed chinese characters sucessfully.
    tried to store a chinese character from java application in the client odb -- failed.
    values are getting inserted from the application but when i view them back it shows & # 2 6 0 8 5 ; (i have included a space in between all 8 characters.
    but when i copy this no and paste in msword it shows 日(chinese character)
    i dont know the exact reason for the above scenerio...................
    Also please help me on this too.......
    why can i store & view chinese characters sucessfully in isql*plus from the client machine while i cannot do the same on client odb from java application even though the lite config are done to support utf8?
    is anything i left out?
    should i do any codes changes in java?(java application is of verision jdk1.4_13)
    Thanks,
    Ashok kumar.G

    Sorry for late replay!! in the SharePoint server both the Claim based and Classic mode is enabled in the server, but still I want to get authenticated via Classic mode just like it happens in SharePoint  2007 and 2010, so do i have to use a different
    set of classes to do that if yes can you please tell me those ?

  • How can I change java.policy at runtim on client machines using java webst?

    Hi,
    I have to change java.policy to launch my application through webstart to provide one RuntimePermission "permission java.lang.RuntimePermission "getClassLoader";"
    Its because of a bug in java bug "_http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4809366_"
    So, my problem here is, how can I do this dynamically on each client machine's java.policy.
    I have spent time on this and found some alternatives
    1. Specifying an Additional Policy File at Runtime by launching application "java -Djava.security.manager -Djava.security.policy=someURL SomeApp"
    Please refer more on this "http://docs.oracle.com/javase/6/docs/technotes/guides/security/PolicyFiles.html"
    But, here the problem is, how can I do this using webstart (expert.jnlp) file even though I have the "java-vm-args" tag, its not supporting this argument.
    Please refer "http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html#security";
    2. Implementing the Policy in code.
    But, not sure how to do this..
    How can I grant the runtime permission on every user's machine dynamycally?
    Here are some background details on this:
    I am using java6 and weblogic 10.3.3.
    Here is thing that I tried,
    My application downloads a few jars to the client machines using java webstart and then it will get the initial context using the t3 protocal. The jars include wlclient.jar and ojdbc6.jar initially.
    The problem here I was facing, when I tried request a bean, it is giving me the following exception in the client logs.It is requesting one state less session bean and I checked the server logs as well and the bean has returned the expected values properly.
    But here I observed one more thing, before this request, one session bean(state less) has been requested successfully.
    java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
    org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: No
    at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
    at com.mbt.expert.server.util._ServerDBQueryObjectRemote_Stub.getExchangeList(Unknown Source)
    at com.mbt.expert.util.DBQueryObject.getExchangeList(DBQueryObject.java:419)
    at com.mbt.expert.view.dialogs.OpenExchangeDialog.actionPerformed(OpenExchangeDialog.java:425)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.Dialog$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Unknown Source)
    at com.mbt.expert.view.dialogs.OpenExchangeDialog.displayDialog(OpenExchangeDialog.java:606)
    at com.mbt.expert.mdi.actions.OpenExchangeAction.execute(OpenExchangeAction.java:204)
    at com.mbt.mdi.MDICommand.actionPerformed(MDICommand.java:47)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    ... 80 more
    The same is working in some other machine which are in different network. So, I have replaced the wlclient.jar with the wlthint3client.jar.
    After replacing this jar I was getting the below exception in client logs while requesting a state less session bean.I also checked whether the request is reaching the server (bean) or not, but its not reaching the server.The problem is same at all the machines irrespective of the networks.
    java.lang.AssertionError: Failed to generate class for com.mbt.expert.server.session.LoginSessionBean_tqw6yu_HomeImpl_1033_WLStub
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:797)
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:786)
    at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:74)
    at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:213)
    at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:207)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:598)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
    at weblogic.jndi.internal.ServerNamingNode_1033_WLStub.lookup(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:405)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at com.mbt.expert.mdi.ExpertVariable.getLoginSession(ExpertVariable.java:455)
    at com.mbt.expert.view.dialogs.Login.okPressed(Login.java:187)
    at com.mbt.expert.view.dialogs.Login.keyPressed(Login.java:141)
    at java.awt.Component.processKeyEvent(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:795)
    ... 55 more
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
    at weblogic.utils.classloaders.AugmentableClassLoaderManager.getAugmentableClassLoader(AugmentableClassLoaderManager.java:48)
    at weblogic.rmi.internal.ClientRuntimeDescriptor.findLoader(ClientRuntimeDescriptor.java:254)
    at weblogic.rmi.internal.ClientRuntimeDescriptor.getInterfaces(ClientRuntimeDescriptor.java:132)
    at weblogic.rmi.internal.StubInfo.getInterfaces(StubInfo.java:77)
    at com.mbt.expert.server.session.LoginSessionBean_tqw6yu_HomeImpl_1033_WLStub.ensureInitialized(Unknown Source)
    at com.mbt.expert.server.session.LoginSessionBean_tqw6yu_HomeImpl_1033_WLStub.<init>(Unknown Source)
    ... 60 more
    I have tried one more thing, I have taken all the required jars to one of the client machines and executed the main class (by setting the required class path) from cmd using java instead of javaws. Surprisingly, its working fine with out any problem using the wlthint3client.jar.
    I also tried the same, by placing wlclient.jar using java in the same way(from cmd instead of javaws ), but I was facing the same exception while requesting the second session bean and found the same above exception in client logs.
    To resolve this, I come across the java bug that I have given earlier "_http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4809366_".
    In that page, I found a work around for this; suggested by bea to add the Runtime permission "permission java.lang.RuntimePermission "getClassLoader";" to the clients java.policy
    So, please suggest me a way to resolve this problem.
    Please suggest me if you have any other solutions for this problem.
    Thanks in advance :)

    I still think your problem is nothing to do with that ancient non-bug and that you should be looking elsewhere. You might be lucky and find someone here who can say "Ah, I know what that is" but I doubt it because since Oracle took over Sun this site has gone down hill big time.

  • I can't get the VI Server/Client example to work on my PC

    Hi, I was trying to run the VI server and client example but the client could not find the server even when the server was running and both VI's were running on the same computer.
    I checked the VI Server configuration and found that the TCP/IP was not checked off - so I enabled TCP/IP. This did not solve the problem.
    Your help is appreciated
    Keita

    Are you running LabVIEW 7.0? The 7.1 version seems to work reliably but the 7.0 version does not to seem to work most of the time. I am having the same problems as you describe. Must be some bug in 7.0, but I have not had time to compare the code. Anyone?
    LabVIEW Champion . Do more with less code and in less time .

  • Step by Step instructions importing Client Certificates on Java Engine

    Hi All,
    I am trying to configure a <b>Receiver</b> SOAP adapter with SSL, does anybody has step-by-step procedure on how to install the client certificates on Java Engine using Visual Administrator? and refer that keystore in SOAP adapter?
    PI 7.0 SP 09
    UNIX-Sun Soloris.
    Thanks,
    Laxman

    Hey Molugu,
    you shouldn't have to install the client certificates on KeyStorage Service, for receiver adapters. The server's public certificate is sent just in the SSL handshaking. What you should have is the certificate authorization tree in your Trusted ACs Service (if the issuer of your client's certificate is not already there).
    You need to install client certificates in sender adapters, when your client uses authentication through certificate. Then you need to install that authentication certificate for the authorized users.
    Check the following link for SSL on J2EE: http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/2de3be0382df45a398d3f9fb86a36a/frameset.htm
    Regards,
    Henrique.

  • Can't run app-client example (cont.)

    I added an application-client.xml file in src\client:
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
    <application-client>
    <display-name>WS Application Client</display-name>
    <web-service>
    <display-name>A Basic Hello World Web Service </display-name>
    <description>A webservice that takes a string input and returns one</description>
    <wsdl-input url="http://localhost:8888/hello/HelloService?WSDL">
    </wsdl-input>
    <source-output-dir>build/src/client</source-output-dir>
    <proxy-gen>
    <package-name>oracle.demo.hello</package-name>
    <output>build/classes/client</output>
    <http-proxy>www-proxy.us.oracle.com:80</http-proxy>
    </proxy-gen>
    </web-service>
    </application-client>
    No longer have the complaint about that file. The error changes to:
    assemble:
    is-remote-ws-up:
    [get] Getting: http://localhost:8888/hello/HelloService?wsdl
    run:
    [echo] invoking webservice application client..
    [java] ServiceConsumerAppClient:consumeService() invoked
    [java] javax.naming.NameNotFoundException: hello/HelloService not found in Application
    Client
    [java] at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:101)
    [java] at com.oracle.naming.J2EEContext.lookup(J2EEContext.java:84)
    [java] at com.evermind.naming.SubFilterContext.lookup(SubFilterContext.java:59)
    [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
    [java] at oracle.ServiceConsumerAppClient.consumeService(ServiceConsumerAppClient.j
    ava:38)
    [java] at oracle.ServiceConsumerAppClient.main(ServiceConsumerAppClient.java:24)
    [java] result from service :hello/HelloService not found in Application Client
    all:
    BUILD SUCCESSFUL
    Out of the box, the app-client is trying to connect to:
    Service service = (Service)ic.lookup("java:comp/env/service/MyHelloServiceRef");
    The complaint is that:
    hello/HelloService not found
    So which should it be? 'service/MyHelloServiceRef' or 'hello/HelloService'
    And which source and config files need to be modified.
    Also notice that i don't have any client stub files in my build\classes directory. That seems a bit odd. Do I need to gen-stubs as part of the build process?
    -David

    Hi David,
    Not sure if you are still facing the issue .
    Just wanted to point out a couple of things which might becausing your app-client demo to fail .
    1. The remote webservice application which this client is trying to consume , the helloservice,application is not deployed .
    2. The packaged application-client.xml is fine , this is a special demo showing how you can invoke a webservice if you are interested in doing only certain things and not others .Look inside the client code of this demo and compare it with client of say the web-client/ demo .The different invocation styles .
    3. The 'result.wsdl' that you see is just a copy of the remote ws's wsdl , that gets saved as a result of the ant tasks which checks to see if the remote ws is up .
    4. Do an ant clean and run the tests again and let us know if the error's persists in your environment .

  • Finding an EJB object. Web clients vs. Java clients

    From what I've read this is the process for a web client to find an EJB object: the client uses JDNI to find a reference to the EJBHome interface and then it uses the create method from this interface which makes the container to begin to work, creating an instance of the implementation class and an instance of the EJBObject interface, and returning a reference to the EJBObject, which will be used by the client to call the methods.
    Are there any differences if the client is a java application and not a web client?

    The Java Client talk to the server with random ports
    not 80. Gives me a headache. _*why?
    There's no need to get headaches about it, in fact no need to worry about it at all.
    Just have the JNDI services available so you can do the lookup (which might require opening a port (or more than one) on the firewall, but that's it.
    And that's no different between a standalone client and a web application client. Both need to do that JNDI lookup.

  • Calling SAP GUI Client from a Java Webdynpro app.

    Hello experts,
    We would like to call the SAP GUI client from a java WebDynpro application running without portal or ITS. Can it be done by having a web link, with mime registration in internet explorer to kick off the SAP GUI ? (similar behavior with a SAP favorite link saved on the desktop).
    many Thanks.

    Hi,
    Webdynpro possibilities:
    1. You can try to use LinkToUrl.
    with reference to file://<exefile> or your weblink with the mime type (possibly some java coding can be required; I can try to help).
    2. other option is to use IFrame and you can use either href to your exe or weblink
    Web Explorers:
    1. IE: It should work. if you point to exe file popup window will be displayed asking for action (run, save, cance).
    2. Firefox: the only way I know to make it work is to modify nsHelperAppDlg.js file (if you need Firefox I can tell you how to modify the file).
    Kind Regards, Jack

  • File transfer, read write through sockets in client server programming java

    Hello All, need help again.
    I am trying to create a Client server program, where, the Client first sends a file to Server, on accepting the file, the server generates another file(probably xml), send it to the client as a response, the client read the response xml, parse it and display some data. now I am successful sending the file to the server, but could not figure out how the server can create and send a xml file and send it to the client as response, please help. below are my codes for client and server
    Client side
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class XMLSocketC
         public static void main(String[] args) throws IOException
              //Establish a connection to socket
              Socket toServer = null;
              String host = "127.0.0.1";     
              int port = 4444;
              try
                   toServer = new Socket(host, port);
                   } catch (UnknownHostException e) {
                System.err.println("Don't know about host: localhost.");
                System.exit(1);
            } catch (IOException e) {
                System.err.println("Couldn't get I/O for the connection to host.");
                System.exit(1);
              //Send file over Socket
            //===========================================================
            BufferedInputStream fileIn = null;
              BufferedOutputStream out = null;
              // File to be send over the socket.
              File file = new File("c:/xampp/htdocs/thesis/sensorList.php");
              // Checking for the file to be sent.
              if (!file.exists())
                   System.out.println("File doesn't exist");
                   System.exit(0);
              try
                   // InputStream to read the file
                   fileIn = new BufferedInputStream(new FileInputStream(file));
              }catch(IOException eee)
                   System.out.println("Problem, kunne ikke lage fil");
              try
                   InetAddress adressen = InetAddress.getByName(host);
                   try
                        System.out.println("Establishing Socket Connection");
                        // Opening Socket
                        Socket s = new Socket(adressen, port);
                        System.out.println("Socket is clear and available.....");
                        // OutputStream to socket
                        out = new BufferedOutputStream(s.getOutputStream());
                        byte[] buffer = new byte[1024];
                        int numRead;
                        //Checking if bytes available to read to the buffer.
                        while( (numRead = fileIn.read(buffer)) >= 0)
                             // Writes bytes to Output Stream from 0 to total number of bytes
                             out.write(buffer, 0, numRead);
                        // Flush - send file
                        out.flush();
                        // close OutputStream
                        out.close();
                        // close InputStrean
                        fileIn.close();
                   }catch (IOException e)
              }catch(UnknownHostException e)
                   System.err.println(e);
            //===========================================================
            //Retrieve data from Socket.
              //BufferedReader in = new BufferedReader(new InputStreamReader(toServer.getInputStream()));
              DataInputStream in = new DataInputStream(new BufferedInputStream(toServer.getInputStream()));
              //String fromServer;
            //Read from the server and prints.
              //Receive text from server
              FileWriter fr = null;
              String frn = "xxx_response.xml";
              try {
                   fr = new FileWriter(frn);
              } catch (IOException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              try{
                   String line = in.readUTF();                    //.readLine();
                   System.out.println("Text received :" + line);
                   fr.write(line);
              } catch (IOException e){
                   System.out.println("Read failed");
                   System.exit(1);
            in.close();
            toServer.close();
    public class XMLSocketS
          public static void main(String[] args) throws IOException
              //Establish a connection to socket
               ServerSocket serverSocket = null;
                 try {
                     serverSocket = new ServerSocket(4444);
                 } catch (IOException e) {
                     System.err.println("Could not listen on port: 4444.");
                     System.exit(1);
              Socket clientLink = null;
              while (true)
                        try
                             clientLink = serverSocket.accept();
                           System.out.println("Server accepts");
                             BufferedInputStream inn = new BufferedInputStream(clientLink.getInputStream());
                             BufferedOutputStream ut = new BufferedOutputStream(new FileOutputStream(new File("c:/xampp/htdocs/received_from_client.txt")));
                             byte[] buff = new byte[1024];
                             int readMe;
                             while( (readMe = inn.read(buff)) >= 0)
                             {     //reads from input stream, writes the file to disk
                                  ut.write(buff, 0, readMe);
                             // close the link to client
                             clientLink.close();                         
                             // close InputStream
                             inn.close();                         
                             // flush
                             ut.flush();                         
                             // close OutputStream
                             ut.close();     
                             //Sending response to client     
                             //============================================================
                             //============================================================
                             System.out.println("File received");
              }catch(IOException ex)
              {System.out.println("Exception.");}
                        finally
                             try
                                  if (clientLink != null) clientLink.close();
                             }catch(IOException e) {}
                 clientLink.close();
                 //serverSocket.close();
    }

    SERVER
    import java.net.*;
    import java.io.*;
    public class XMLSocketS
          public static void main(String[] args) throws IOException
                   //Establish a connection to socket
               ServerSocket serverSocket = null;
                 try {
                     serverSocket = new ServerSocket(4545);
                 } catch (IOException e) {
                     System.err.println("Could not listen on port: 4444.");
                     System.exit(1);
              Socket clientLink = null;
                  try
                             clientLink = serverSocket.accept();
                         System.out.println("Server accepts the client request.....");
                         BufferedInputStream inn = new BufferedInputStream(clientLink.getInputStream());
                             BufferedOutputStream ut = new BufferedOutputStream(new FileOutputStream(new File("c:/xampp/htdocs/received_from_client.txt")));
                             byte[] buff = new byte[1024];
                             int readMe;
                             while( (readMe = inn.read(buff)) >= 0)
                             {     //reads from input stream, writes the file to disk
                                  ut.write(buff, 0, readMe);
                             ut.flush();                         
                             //Sending response to client     
                             //============================================================
                             BufferedInputStream ftoC = null;
                             BufferedOutputStream outtoC = null;
                             // File to be send over the socket.
                             File file = new File("c:/xampp/htdocs/thesis/user_registration_response.xml");
                             try
                                  // InputStream to read the file
                                   ftoC = new BufferedInputStream(new FileInputStream(file));
                             }catch(IOException eee)
                             {System.out.println("Problem reading file");}
                             // OutputStream to socket
                             outtoC = new BufferedOutputStream(clientLink.getOutputStream());
                             byte[] buffer = new byte[1024];
                             int noRead;
                             //Checking if bytes available to read to the buffer.
                             while( (noRead = ftoC.read(buffer)) >= 0)
                                  // Writes bytes to Output Stream from 0 to total number of bytes
                                  outtoC.write(buffer, 0, noRead);
                             outtoC.flush();
                             //============================================================
                             System.out.println("File received");
              }catch(IOException ex)
              {System.out.println("Exception.");}
                        finally
                             try
                                  if (clientLink != null) clientLink.close();
                             }catch(IOException e) {}
                 clientLink.close();
                 //serverSocket.close();
          }CLIENT SIDE
    import java.io.*;
    import java.net.*;
    public class XMLSocketC
              @SuppressWarnings("deprecation")
              public static void main(String[] args)
                   // Server: "localhost" here. And port to connect is 4545.
                   String host = "127.0.0.1";          
                   int port = 4545;
                   BufferedInputStream fileIn = null;
                   BufferedOutputStream out = null;
                   // File to be send over the socket.
                   File file = new File("c:/xampp/htdocs/thesis/sensorList.xml");
                   try
                        // InputStream to read the file
                        fileIn = new BufferedInputStream(new FileInputStream(file));
                   }catch(IOException eee)
                   {System.out.println("Problem");}
                   try
                             System.out.println("Establishing Socket Connection");
                             // Opening Socket
                             Socket clientSocket = new Socket(host, port);
                             System.out.println("Socket is clear and available.....");
                             // OutputStream to socket
                             out = new BufferedOutputStream(clientSocket.getOutputStream());
                             byte[] buffer = new byte[1024];
                             int numRead;
                             //Checking if bytes available to read to the buffer.
                             while( (numRead = fileIn.read(buffer)) >= 0)
                                  // Writes bytes to Output Stream from 0 to total number of bytes
                                  out.write(buffer, 0, numRead);
                             // Flush - send file
                             out.flush();
                             //=======================================
                             DataInputStream in = new DataInputStream(new BufferedInputStream(clientSocket.getInputStream()));
                             BufferedWriter outf = new BufferedWriter(new FileWriter("c:/xampp/htdocs/received_from_server.txt",true));
                             String str;
                             while(!(str = in.readLine()).equals("EOF")) {     
                                  System.out.println("client : Read line -> <" + str + ">");
                                  outf.write(str);//Write out a string to the file
                                  outf.newLine();//write a new line to the file (for better format)
                                  outf.flush();
                             //=======================================
                             // close OutputStream
                             out.close();
                             // close InputStrean
                             fileIn.close();
                             // close Socket
                             clientSocket.close();
                        }catch (IOException e)
                        {System.out.println("Exception.");}
         Could you please point where am I doing the stupid mistake, client to server is working properly, but the opposite direction is not.
    Thanks

  • Need a Telnet Client Implementation in Java

    Hi,
    I am looking for a Telnet Client Class in Java.
    Any pointers on this is appreciated.
    regards,
    jitu

    How to:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=58110
    + http://www.mud.de/se/jta/ to download
    http://forum.java.sun.com/thread.jsp?forum=31&thread=177316
    About problems:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=179353
    http://forum.java.sun.com/thread.jsp?forum=31&thread=227092

  • ECM java client - example code

    Hi,
    Enviroment: ECM 11.x
    I need to write ADF application integrated wit ECM. Is there any public java codes with examples ? I mean somethink like examples for SOA Suite http://java.net/projects/oraclesoasuite11g/pages/Home covers e.g. example how to write custom worklist. My requairement is to write some functionality from ECM console, so it would be useful to have some java api usage examples.
    Kuba

    Actually, what workflows you intend to use? And, what's your use case what-so-ever?
    I hope I won't confuse you, but in fact, you could mean three things:
    - use UCM native (iDocScript workflows)
    - use BPEL workflows
    - use BPM workflows (as BPM Suite is now also part of the license)
    The last is completely driven from the BPM side, so there you don't need to do anything.
    The second works like this: you may define a criteria workflow which passes the item to a BPEL workflow. When BPEL finishes, it passes the workflow back to release the item. If you have samples for SOA Suite, you could reuse them.
    Only for UCM native workflows, you would need to write your own codes (calling services - most likely WS), but havinf the first two options, is it worth?

  • Cannot acess file on server from client machine using java web start

    Hi everyone,
    I am creating an appication using JWS and Apache Web Server version 2.0.54 on Linux. I am trying to access a file on the server that IS NOT inside the jar file. I have given full access (r, w, x) to all users on my server. We also created a FilePermission object and gave the file read and write access as well. But when we deploy the program and try to get this file, a SecurityException is thrown with the following mesage:
    acess denied (java.io.FilePermission filename read) where filename is the file in our local filesystem. Any suggestions on what I can do?
    Any help would be greatly appreciated.
    Thanks,
    Raj

    It sounds like you are trying to access the file as if your JNLP application were running on the server. The JNLP app is running on the client machine, so you will need to use a URL to open the file. Take a look at the JavaDocs for the following:
         java.net.URL
         java.net.URI
         java.net.File
    You also need to be sure your server is configured to serve the file. For example, you ought to be able to access the file through your browser using something like http://www.myco.com/myapp/myfile.txt. (How you configure your server is a topic for a different forum.)
    You probably also want to look into JavaWS security, and even Java security in general to determine if you need to sign your app or not. Here are some links to get you started:
            http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/development.html#security
            http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/security.html
            http://java.sun.com/sfaq/
            http://java.sun.com/j2se/1.5.0/docs/guide/security/permissions.html
            http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html
    Mike.

Maybe you are looking for

  • Check for Company Code & Vendor Relation ship before a PO is saved

    Scenario ,: If the Vendor doesn’t belong to the same CoCd as SAP accepts in this stage the PR/PO , the problem will not appear at this stage og MIGO  but will appear after the goods have been received and then it will appear when we want to enter the

  • File folder with question mark inside of it

    I have an older MacBook and a couple of days ago upon turning on the Mac a file folder appeared with a question mark inside of it. What does it mean and how do I fix the problem. Thanks

  • Facetime has old picture no video voice ok

    facetime kept old picture no video, audio ok in wifi

  • ProvisionUsers Utility

    We used MSAD with shared services , MSAD user can login into workspace but not open planning application, we executed provisionusers.cmd utility to apply MSAD users sid into planning application, but we got an error as below in essbase server log, Si

  • Showing current date and the last 250 working days

    Hi, we need to report the current day and the last 250 working days. How can I implement this into the BEx by using a variable for the current day selection. How can the selection of the last 250 working days work? Thanx René