How to bind the java client stub and the C++ server's skeleton?

hi, i'm currently working on a project which a java client invoke a C++ object.
i've wrote the idl and compile it using idl2cpp and a object is created.
then i try to compile my java client using vbjc Client. it was done without errors.
but when i try to run the client (after i run the smart agent and the C++ server) using vbj Client, it promts error which fail to load the class Client.java
and i've try to run my java client using jre (java Client), the program throws exception --> org.omg.CORBA.BAD_PARAM: minor code: 0 completed: No
so, wat's wrong with my codes actually??
it's urgent and i really need you all's help...
thanks a lot...

below is my code:
TimeObject.cpp (C++ server)
#include "TimeImpl.h"
// USE_STD_NS is a define setup by VisiBroker to use the std namespace
USE_STD_NS
int main(int argc, char* const* argv)
try {
// Initialize the ORB.
CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv);
/* // Initialize the BOA
CORBA::BOA_ptr boa = orb->BOA_init(argc, argv);
// Create the Time object
POA_Time::TimeSetting timesetting = new TimeSettingImpl("My TimeSetting");
// Export the newly created object
boa->obj_is_ready(timesetting);
// Ready to service requests
boa->impl_is_ready(); */
// get a reference to the root POA
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(obj);
CORBA::PolicyList policies;
policies.length(1);
policies[(CORBA::ULong)0] = rootPOA->create_lifespan_policy(
PortableServer::PERSISTENT);
// get the POA Manager
PortableServer::POAManager_var poa_manager = rootPOA->the_POAManager();
// Create myPOA with the right policies
PortableServer::POA_var myPOA = rootPOA->create_POA("sntp_poa",
poa_manager,
policies);
// Create the servant
TimeSettingImpl timeServant;
// Decide on the ID for the servant
PortableServer::ObjectId_var managerId =
PortableServer::string_to_ObjectId("TimeManager");
// Activate the servant with the ID on myPOA
myPOA->activate_object_with_id(managerId, &timeServant);
// Activate the POA Manager
poa_manager->activate();
CORBA::Object_var reference = myPOA->servant_to_reference(&timeServant);
cout << reference << " is ready" << endl;
// Wait for incoming requests
orb->run();
catch(const CORBA::Exception& e) {
cerr << e << endl;
return 1;
return 0;
Client.java:
import java.net.*;
import java.io.*;
import java.util.*;
import java.lang.*;
public class Client
     public static void main(String args[]) throws IOException, InterruptedException
          try
               // Initialize the ORB
               System.out.println("Initializing the ORB");
               org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
               // Get the manager Id
               byte[] managerId = "TimeManager".getBytes();
               System.out.println("get the manager id");
               // Locate an account manager. Give the full POA name and the servant ID.
               Time.TimeSetting time =
               Time.TimeSettingHelper.bind(orb, "/sntp_poa", managerId);
               System.out.println("bind the object");
               // Bind to the TimeSetting Object
               //System.out.println("Binding to TimeSetting Object");
               //Time.TimeSetting time = Time.TimeSettingHelper.bind(orb, "My TimeSetting");
               SntpClient client = new SntpClient();
               long Offset = client.synchronizeTime();
               // Set offset
               System.out.println("Setting offset to" + Offset);
               time.offset((long)Offset);
               // Set the system time
               System.out.println("Setting system time");
               time.SetTime();
          } catch (org.omg.CORBA.SystemException e)
               System.out.println("System Exception");
               System.err.println(e);

Similar Messages

  • Methods work on Client(stub) and not on Server

    package rmi;
    import java.io.Serializable;
    import java.rmi.RemoteException;
    import javax.swing.JOptionPane;
    import rmi.persistence.IUser;
    import rmi.persistence.User;
    import server.socket.Recording;
    public class UserHandle implements Serializable, IUserHandle{
         private static final long serialVersionUID = 1L;
         private User user;
         private int port;
         public UserHandle(int sport, String usr){
              port = sport;
              user = new User(usr);
              JOptionPane.showMessageDialog(null,"user " + user.getName() +" on port " + port + " logged in");
         public boolean startRecording(String file) throws RemoteException{
              JOptionPane.showMessageDialog(null,"in startRecording");
              try{
                   new Recording(this,file).start();
                   return true;
              } catch (Exception e){
                   return false;
         public boolean startPlaying(String file) throws RemoteException{
              return true;
         public int getPort() throws RemoteException{
              JOptionPane.showMessageDialog(null,"in getPort");
              return port;
         public IUser getUser() throws RemoteException{
              JOptionPane.showMessageDialog(null,"in getUser");
              return user;
    }This is an Object createt with RMI on the Server, the JOptionPane in the Constructor is correctly shown on the server, but when i call methods on this object, the JOptionPanes are shown on the Client, wich is obviously not what i want, i thought that these functioncalls are transferred to the server and executet there!
    finally getUser und getPort show the correct names but new Recording(this,file).start(); won't work since its called on the clientside oder the stub and not transferred to the server...
    How may i solve this? I want to create a new Recording on the Server.
    regards Norbert

    public class UserHandle implements Serializable, IUserHandle{Here you've said that it implements Serializable, and it's not an exported remote object, so it's serialized to the client. Java did exactly what you told it to do. Perhaps what you mean is this:
    public class UserHandle extends UnicastRemoteObject implements IUserHandle{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to bind the database?

    How to bind the database and to place the data of a field in a EditBox and to modify the data of a table.

    Hi,
    Here got one example.
    Private oUserDataSource As SAPbouiCOM.UserDataSource
    oNewItem = oForm.Items.Add("ET_GUID", SAPbouiCOM.BoFormItemTypes.it_EXTEDIT)
    oEditText = oNewItem.Specific
    oUserDataSource = oForm.DataSources.UserDataSources.Add("U_GUID", SAPbouiCOM.BoDataType.dt_LONG_TEXT, 60)
                    oEditText.DataBind.SetBound(True, "TableName", "FieldName")
    Hope this helps,
    Bruce.

  • How do I install JAVA JVM, JServer and XDK in Oracle Express Ed database

    IF I query with SELECT COUNT(*) FROM all_objects WHERE object_type LIKE 'JAVA%'; I get a count of 0.
    I see no DBMS_JAVA package.
    How can I install JAVA JVM, JServer and XDK in the Oracle Express Edition database?
    I see no initjvm.sql, initxml.sql and xmlja.sql scripts. There are catjava.sql and catexf.sql scripts in the rdbms/admin folder.

    cssifah,
    Looks like you want this Web page:
    http://www.oracle.com/technology/products/database/xe/forum.html
    Good Luck,
    Avi.

  • How to configure the smtp server..

    i had an error when running the java mail program..
    this is my program
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.*;
    import java.util.Properties;
    public class MailClient
    public void sendMail(String mailServer, String from, String to,
    String subject, String messageBody,
    String[] attachments) throws
    MessagingException, AddressException
    // Setup mail server
    Properties props = System.getProperties();
    props.put("mail.smtp.host", mailServer);
    // Get a mail session
    Session session = Session.getDefaultInstance(props, null);
    // Define a new mail message
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setSubject(subject);
    // Create a message part to represent the body text
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(messageBody);
    //use a MimeMultipart as we need to handle the file attachments
    Multipart multipart = new MimeMultipart();
    //add the message body to the mime message
    multipart.addBodyPart(messageBodyPart);
    // add any file attachments to the message
    // addAtachments(attachments, multipart);
    // Put all message parts in the message
    message.setContent(multipart);
    // Send the message
    Transport.send(message);
    protected void addAtachments(String[] attachments, Multipart multipart)
    throws MessagingException, AddressException
    for(int i = 0; i<= attachments.length -1; i++)
    String filename = attachments;
    MimeBodyPart attachmentBodyPart = new MimeBodyPart();
    //use a JAF FileDataSource as it does MIME type detection
    DataSource source = new FileDataSource(filename);
    attachmentBodyPart.setDataHandler(new DataHandler(source));
    //assume that the filename you want to send is the same as the
    //actual file name - could alter this to remove the file path
    attachmentBodyPart.setFileName(filename);
    //add the attachment
    multipart.addBodyPart(attachmentBodyPart);
    public static void main(String[] args)
    try
    MailClient client = new MailClient();
    String server="smtp.canvasindia.com";
    String from="[email protected]";
    String to = "[email protected]";
    String subject="Test";
    String message="Testing";
    String[] filenames ={"c:/A.java"};
    client.sendMail(server,from,to,subject,message,filenames);
    catch(Exception e)
    e.printStackTrace(System.out);
    the error is .................
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 553 Attack detected from p
    ool 59.144.8.116. <http://unblock.secureserver.net/?ip=59.144.8.*>
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at MailClient.sendMail(MailClient.java:47)
    at MailClient.main(MailClient.java:84)
    Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 553 Attack detected fro
    m pool 59.144.8.116. <http://unblock.secureserver.net/?ip=59.144.8.*>
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
    ... 5 more
    how to configure the smtp server in my machine..
    please guide me...

    This uses gmail account, and gmail smtp
    * MailSender.java
    * Created on 14 November 2006, 17:07
    * This class is used to send mails to other users
    package jmailer;
    * @author Abubakar Gurnah
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    public class MailSender{
        private String d_email,d_password;
         * This example is for gmail, you can use any smtp server
         * @param d_email --> your gmail account e.g. [email protected]
         * @param d_password  --> your gmail password
         * @param d_host --> smtp.gmail.com
         * @param d_port --> 465
         * @param m_to --> [email protected]
         * @param m_subject --> Subject of the message
         * @param m_text --> The main message body
        public String send(String d_email,String d_password,String d_host,String d_port,
                String m_from,String m_to,String m_subject,String m_text ) {
            this.d_email=d_email;
            this.d_password=d_password;
            Properties props = new Properties();
            props.put("mail.smtp.user", d_email);
            props.put("mail.smtp.host", d_host);
            props.put("mail.smtp.port", d_port);
            props.put("mail.smtp.starttls.enable","true");
            props.put("mail.smtp.auth", "true");
            //props.put("mail.smtp.debug", "true");
            props.put("mail.smtp.socketFactory.port", d_port);
            props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
            props.put("mail.smtp.socketFactory.fallback", "false");
            SecurityManager security = System.getSecurityManager();
            try {
                Authenticator auth = new SMTPAuthenticator();
                Session session = Session.getInstance(props, auth);
                //session.setDebug(true);
                MimeMessage msg = new MimeMessage(session);
                msg.setText(m_text);
                msg.setSubject(m_subject);
                msg.setFrom(new InternetAddress(m_from));
                msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));
                Transport.send(msg);
                return "Successful";
            } catch (Exception mex) {
                mex.printStackTrace();
            return "Fail";
        //public static void main(String[] args) {
        //    MailSender blah = new MailSender();
        private class SMTPAuthenticator extends javax.mail.Authenticator {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(d_email, d_password);
    }

  • A very simple question: how to obtain the mail server name?

    In our JSP application, at one point an email will be sent to notify one event. Currently, that is done by using the html tag: mailto. To have more control on the email in tems of context format (a bad layout right now) and others. I would like to have it processed at servlet by using the JavaMail API, so that it have a nice format and have the sender's email address right in case email client is not installed in the machine where the browser in. The JavaMail API is straight forward. The question is how to obtain the mail server name, and the sender's email address if there is one?
    Thanks.
    v.

    How to obtain the mail server's name? It's your server, you should know its name. Or if it isn't your server, you should ask the administrator for its name. Point is, you need to decide in advance what server you are going to use and hard-code its name into the program or into a properties file.
    And how to obtain the client's e-mail address? You have to ask the client, probably by putting a box in the HTML and asking them to type it.

  • How To Find The Right Server........

    Hi Friend�s I am Again Here
    I Have A Question. I have Tool That�s Work is To Check The Duplicate CDR from Three day�s dump and Then Load this CDR�s in Database. I runt his tool on 2.4 GHz System with 1GB ram and I got the result
    74 CDR�s /see Processing.
    This time I Have A problem that I need server to run this tool and I am not getting that how I calculate the right server so that I can get the result upto 500 CDR�s/see
    How Much CPU I need and How Much Ram I Needed. As per My Knowledge this can run fine on 2*2.4 GHz dual core CPU with 8GB ram.
    Is it Fine,,,,,,,,,,,,,,,,,,,
    Can anyone Help to Find Right System for this tool.

    Your post is hard/annoying to read. In English only the start of a sentence is capitalized. There is no need to capitalize every word within a sentence, unless required otherwise, like the pronoun "I" or the person/product names, e.g. "John Doe" and "Java".
    Apart from that, your question has nothing to do with Java at all. Look for a CDR software forum or so.

  • How to start the oc4j server

    I install oracle 9ias 9.0.3,but i don't know how to start the oc4j server.
    thanks for any help?

    hi
    Refer "Starting and Stopping OC4J" from
    http://otn.oracle.com/tech/java/oc4j/doc_library/902/A95880_01/html/toc.htm
    hope this helps.
    shrini

  • How to reset the wiki server (MAC OS X 10.9 with OS X Server App Version 3) with all wiki datas only

    Hi,
    I need to reset my Wiki on MAC OS X 10.9 with OS X Server App Version 3, but without reinstalling the whole server app to configure all services.
    Does anybody knows how to reset the wiki server (MAC OS X 10.9 with OS X Server App Version 3) with all wiki datas only.
    Thanks a lot for your hints

    Hi Linc,
    sorry, I haven't saved the System-Logfile before restoring my parallels VM.
    But it looks like issues of linking data.
    For testing the Server services I have done a reset for a user password and I have deleted the profiles and configuration from Client-Side. One with Mac OS X 10.9.1, one iPad with iOS 6.1.3. But it was not possible to reconfigure/reinstall the Server Profile. Also a manually configuration was odd, because for some services the new password was necessary and for other services the old password. Very strange.
    To bring back the services I have rolled back the last snapshot of my parallels VM. Afterwards there was no probleme to reconfigure/reinstall the Profile on Client-Side (OS X 10.9.1 and iOS 6.1.3). Also the manually configuration shows the password for all services are matching with the current configuration.
    I'm going to install a further parallels VM with Mac OS X 10.9.1 and Server App 3 from scratch to move the services.
    Greetings

  • How to access the SAP Server Console? Through VPN

    How to access the SAP Server Console? Through VPN
    Sudhakar

    Hi,
    You need to contact your system admin as they will enable the port in ur system so that u can access client servers.It should also be allowed from client side also i mean access.
    You will connect thru weblink with user name and pw and SAP with logon details.
    Thanks
    Suresh

  • How to setup the SMTP server in Oracle apps?

    Hi,
    How to setup the SMTP server in Oracle Apps? Is it mandatory to keep the SMTP server on the same host where the Oracle data base is installed? Also can someone help how we can set up the SMTP server on different host (not the Database server) and we can use the same for Workflow notification mailer.
    Thanks,
    Bijoy
    Edited by: user12070886 on Feb 6, 2013 4:26 AM
    Edited by: user12070886 on Feb 6, 2013 4:27 AM

    How to setup the SMTP server in Oracle Apps? Is it mandatory to keep the SMTP server on the same host where the Oracle data base is installed? No, it is not mandatory. Also please note that the mails are sent out from concurrent manager mode. Not from the database node.
    Also can someone help how we can set up the SMTP server on different host (not the Database server) and we can use the same for Workflow notification mailer.
    >
    It depends on the operating system you are using. If you are using *nix then sendmail needs to be configured.
    Thanks

  • How to configure the Integration Server Settins?

    Hi,
    I am doing a scenario like Idoc 2 File, I am passing parameter of Adapter Engine is a Integration Server, and when we generate a Idoc and send to XI system using TC: WE19. XI System is not picked the Idoc, and when i am checking RWB the Adapter Framework. Please Guide me how to configure the Integration Server setting.
    Regards
    Mohan

    Hi,
    did you checked the ur IDOC outbound status?
    also check IDX5, whether it has reached XI system.
    plz do check all ur settings:
    1. Create RFC destination to XI in SM59 transaction
    2. Create a port in we21
    3. Create partner profile we20
    4. we05- Idocs monitoring
    XI Settings:
    1. Create RFC destination to XI in SM59 transaction
    2. Idx1 – Port maintenance
    3. Idx2 - Metadata maintenance
    4. Idx5 – All Idoc inbound and outbound messages
    regards
    Message was edited by:
            Vijaya Lakshmi MV

  • How to add the SSO Server Administration portlet to portal

    hi
    I want to use SSO Server Administration portlet ,but when i Navigator to the administer tab .in the portal suntab there is not SSO Server Administration .I want to know why? and how to add the SSO Server Administration portlet to portal.(note:the portal system havn't SSO Server Administration portlet ) .how could i can do it. help !~help!

    thank you IPeters .this problem was solved. the way is: login the portal with orcladmin and the password is the Infru password. In the administrator sub i see the SSO Server Administration portlet .
    thank you very much.

  • How to start the Message Server?

    Hi,
    I wish to start the J2EE engine and for the same it is mandatory to start the Message Server first.
    In order to start the message server, I run the following command:
    <i><b>D:\usr\sap\J2E\SYS\exe\uc\NTI386>msg_server start
    msg_server=>sapparam(1c): No Profile used.
    msg_server=>sapparam: SAPSYSTEMNAME neither in Profile nor in Commandline
    [Thr 7972] Wed Jul 25 23:39:18 2007
    [Thr 7972] *** ERROR => MsSetWorkDir: chdir D:\usr\sap
    D00\work [msntserv.c   170]
    [Thr 7972] *** ERROR => MsSPrvInit: MsSetWorkDir [msntserv.c   87]
    [Thr 7972] *** ERROR => mainU: MsSPrvInit [msxxserv.c   1634]</b></i>
    I gave my best time to search for Profile configuration details. But I could not do that.
    <b>Can  somebody tell me how to start the Message Server?</b>
    regards,
    Anand

    Hi Anand,
    Will be good to know what OS are you using...
    If you're tryng to start an instance use <prompt>: startsap pf=<profile of the system you want to start>
    If you logon as <sid>adm just type startsap
    If for some reason you need to start only the message server try  <prompt>: msg_server start pf=<profile of the system you want to start>
    Regards
    Juan
    Please reward with points if helpful

  • How to change the web server??

    How to change the web server in the details of the mobile application component in the MI webconsole??

    hello irene,
    had your tried checking on the "Use IP instead of host
    name" checkbox?
    to edit your registered application info, go to
    "Upload Mobile Component" tab and click on the Edit icon
    on the left part of the record list which corresponds to
    the application you had just uploaded.
    your application is uploaded to the same host as your
    web console application is running on. if you like to
    point it to a different server where you have your
    archive accessible, you have to change your mcd
    deployment attributes on your middleware. try the ff:
    1)run tcode: mi_mcd
    2)click on Create Mobile Component
    3)Enter Mobile Solution Name and Version
    4)Click on Display MCD
    5)Select Deployment Tab
    6)Click on Edit
    7)Change the values of WEBSERVER and WEBPATH location eg.
      if your archive is located at
      http://myotherserver:80/archive/myapplication.war
      your entry will be:
      WEBSERVER: http://myotherserver:80
      WEBPATH: /archive/myapplication.war
    where you myotherserver is the name of your http host
    server and myapplication.war is the name of your archive.
    the archive directory is just a virtual directory where
    your application archive is.
    you might need to change the port number depending on
    your http server port.
    regards
    jo

Maybe you are looking for