Java Corba Help

Hi,
I'm using Java 1.5 to try out some Corba stuff with the idlj compiler, and am getting errors while testing. Can anyone show me what the problem is? The error is when i run the client code and the error is denoted where i put the comment //CRASH HERE. The stack trace is below as well:
My IDL:
module corbatest
interface Device_CI
readonly attribute long deviceID;
interface NorthBoundInterface
corbatest::Device_CI GetDevice(in long deviceID);
//SERVER CODE
import corbatest.*;
public class DeviceImpl extends Device_CIPOA{
public DeviceImpl() { }
public int deviceID() {
return 44;
import corbatest.*;
import org.omg.CORBA.*;
public class NorthBoundInterfaceImpl extends NorthBoundInterfacePOA {
private ORB orb;
public void setORB(ORB val) {
val = orb;
public Device_CI GetDevice (int deviceID) {
DeviceImpl dev = new DeviceImpl();
Device_CIPOATie tie = new Device_CIPOATie(dev);
return tie._this(orb);
import corbatest.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;
import java.util.Properties;
public class Server{
public static void main(String args[]){
try{
// create and initialize the ORB
     Properties properties = new Properties();
     properties.put("org.omg.CORBA.ORBInitialPort", "1050");
     properties.put("org.omg.CORBA.ORBInitialHost", "localhost");
     ORB orb = ORB.init((String[])null, properties);
// Get reference to rootpoa & activate the POAManager
POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
rootpoa.the_POAManager().activate();
// create servant and register it with the ORB
NorthBoundInterfaceImpl nbiImpl = new NorthBoundInterfaceImpl();
nbiImpl.setORB(orb);
// create a tie, with servant being the delegate.
NorthBoundInterfacePOATie tie = new NorthBoundInterfacePOATie(nbiImpl, rootpoa);
// obtain the objectRef for the tie
NorthBoundInterface nbi = tie._this(orb);
// get the root naming context
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
// Naming Service specification.
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
// bind the Object Reference in Naming
String name = "NorthBoundInterface";
NameComponent path[] = ncRef.to_name( name );
ncRef.rebind(path, nbi);
System.out.println("NorthBoundInterface ready and waiting ...");
// wait for invocations from clients
orb.run();
catch (Exception e){
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
//CLIENT CODE
import corbatest.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.PortableServer.POA;
import java.util.Properties;
public class Client{
     public static void main(String args[]){
     try{
     // create and initialize the ORB
          Properties properties = new Properties();
          properties.put("org.omg.CORBA.ORBInitialPort", "1050");
          properties.put("org.omg.CORBA.ORBInitialHost", "localhost");
          ORB orb = ORB.init((String[])null, properties);
     // get the root naming context
     org.omg.CORBA.Object objRef =
          orb.resolve_initial_references("NameService");
     NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
     // resolve the Object Reference in Naming
     String name = "NorthBoundInterface";
     NorthBoundInterface nbi = NorthBoundInterfaceHelper.narrow(ncRef.resolve_str(name));
     System.out.println("Obtained a handle on server object: " + nbi);
     //CRASH HERE
     Device_CI device = nbi.GetDevice(44);
     int x = device.deviceID();
     catch (Exception e) {
     System.out.println("ERROR : " + e) ;
     e.printStackTrace(System.out);
RROR : org.omg.CORBA.UNKNOWN: ----------BEGIN server-side stack trace----------
org.omg.CORBA.UNKNOWN: vmcid: SUN minor code: 202 completed: Maybe
     at com.sun.corba.se.impl.logging.ORBUtilSystemException.runtimeexception(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.convertThrowableToSystemException(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(Unknown Source)
     at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(Unknown Source)
     at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(Unknown Source)
     at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(Unknown Source)
     at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(Unknown Source)
     at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
     at org.omg.PortableServer.Servant._this_object(Unknown Source)
     at corbatest.Device_CIPOA._this(Device_CIPOA.java:68)
     at NorthBoundInterfaceImpl.GetDevice(NorthBoundInterfaceImpl.java:15)
     at corbatest.NorthBoundInterfacePOATie.GetDevice(NorthBoundInterfacePOATie.java:39)
     at corbatest.NorthBoundInterfacePOA._invoke(NorthBoundInterfacePOA.java:38)
     at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(Unknown Source)
     ... 9 more
----------END server-side stack trace---------- vmcid: SUN minor code: 202 completed: Maybe

You have 2 sets of errors, at least.
The first is : Exception in thread "main" java.lang.NoClassDefFoundError: java/util/HashSet which is that you have not imported the class for hashset.
The second is that the import of the jars is probably wrong, hard to say without seeing code.

Similar Messages

  • Not able to connect to Lotus Domino server using java/corba

    Hi
    I am new to Lotus Domino server and Java.
    I have INstalled Lotus Domino server5 on 1 machine and was successful in installing the Lotus client on another machine.
    Throught the lotus client i am able to connect to the server and send and receive the mails.
    Now I want to connect to the domino server using the Lotus Domino Tolkit for Java/Corba.
    In this Toolkit they have given the sample code program ..
    if I run the code I am getting the error
    java.io.FileNotFoundException: http://<IPADDRESS>/diiop_ior.txtjava.io.FileNotFoundException: http://<IPADDRESS>/diiop_ior.txt
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:691)
    at java.net.URL.openStream(URL.java:942)
    at lotus.domino.NotesFactory.getIOR(NotesFactory.java:314)
    at lotus.domino.NotesFactory.createSession(NotesFactory.java:66)
    at IntroCorbaApp.run(IntroCorbaApp.java:65)
    at java.lang.Thread.run(Thread.java:539)
    lotus.domino.NotesException: Could not get IOR from HTTP Server
    lotus.domino.NotesException
    at lotus.domino.NotesFactory.getIOR(NotesFactory.java:344)
    at lotus.domino.NotesFactory.createSession(NotesFactory.java:66)
    at IntroCorbaApp.run(IntroCorbaApp.java:65)
    at java.lang.Thread.run(Thread.java:539)
    I also tried to find this file in the Domino server directory.
    The file exists in drive:\LotusServer\Domino\Data\Domino\HTML directory..
    I am not getting what exactly is the Problem
    Plz any one help me in this regard..
    thanks in advance

    You should be able to access the diiop_ior.txt file from browser without authentication,only then it will work. This file should not
    be protected.

  • Java Access Helper Jar file problem

    I just downloaded Java Access Helper zip file, and unzipped, and run the following command in UNIX
    % java -jar jaccesshelper.jar -install
    I get the following error message, and the installation stopped.
    Exception in thread "main" java.lang.NumberFormatException: Empty version string
    at java.lang.Package.isCompatibleWith(Package.java:206)
    at jaccesshelper.main.JAccessHelperApp.checkJavaVersion(JAccessHelperApp.java:1156)
    at jaccesshelper.main.JAccessHelperApp.instanceMain(JAccessHelperApp.java:159)
    at JAccessHelper.main(JAccessHelper.java:39)
    If I try to run the jar file, I get the same error message.
    Does anyone know how I can fix this?
    Thanks

    Cross-posted, to waste yours and my time...
    http://forum.java.sun.com/thread.jsp?thread=552805&forum=54&message=2704318

  • Java Access Helper problem

    I just downloaded Java Access Helper zip file, and unzipped, and run the following command in UNIX
    % java -jar jaccesshelper.jar -install
    I get the following error message, and the installation stopped.
    Exception in thread "main" java.lang.NumberFormatException: Empty version string
    at java.lang.Package.isCompatibleWith(Package.java:206)
    at jaccesshelper.main.JAccessHelperApp.checkJavaVersion(JAccessHelperApp.java:1156)
    at jaccesshelper.main.JAccessHelperApp.instanceMain(JAccessHelperApp.java:159)
    at JAccessHelper.main(JAccessHelper.java:39)
    If I try to run the jar file, I get the same error message.
    Does anyone know how I can fix this?
    Thanks

    sorry ab the multiple post, it was urgent for me to
    know the answer.
    I've JDK 1.4.2 and JAccessHelper should work with 1.3
    or later
    Can there be some kind of path problems?No, I doubt it. It's just some internal app failure - looks like it's trying to determine the running Java version, and is not doing a good job at it. But the failure has nothing per se to Java, it's that specific app - what are we supposed to know about that app though?

  • New to java(need help on access specifier)

    hi! i am new to java.plzzzzz help me i have to make a project on access specifier's i know all theroy.but
    i am unable to understand how i can define all specifiers practicly.i mean in a program.
    thanks.plzzzzzzzz help me

    the most common project i can think of is a payroll system..
    you can have real implementation of all the access specifiers
    good luck

  • Pascal to Java Please help me!

    I am truobled in creating a validation method for the user loging in....
    As I am perfect at Pascal can anyone translate the following pascla code to Java Please help me with this.
    PROGRAM USERLOGIN;
    TYPE
      USER_TYPE = RECORD
        USERNAME : STRING[15];
        PASSWORD : STRING[15];
    END;
        USFILE = FILE OF USER_TYPE;
    VAR
       USER: USER_TYPE;
       CKUSER: USER_TYPE;
       RECFILE : USFILE;
       I,J     : INTEGER;
    BEGIN
    WRITE('ENTER USERNAME:');READLN(CKUSER.USERNAME);
    WRITE('ENTER PASSWORD:');READLN(CKUSER.PASSWORD);
    FILESPEC :='USERFILE.USR';
    ASSIGN(RECFILE, FILESPEC);
    RESET(RECFILE);
      WHILE NOT EOF(RECFILE) DO
       BEGIN
         READ(RECFILE, USER);
         IF CKUSER.USERNAME = USER.USERNAME AND CKUSER.PASSWORD = USER.PASSWORD THEN
              LOGIN
        ELSE
              WRITE('USER NOT FOUND');
       END;
    END.Thank you

    Don't bother:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=539277

  • How I can enable Java ssv helper plugin silently for win7 users with IE9

    here is what happens:
    when I deploy java 7.21 on win7 users, after deployment when users try to Open their IE they get a login screen and apparently it is related to Java ssv helper plugin. it is trying to enable it and needs admin account/password. I am trying to deploy this to about 3000 computers and I dont want all of them start calling helpdesk for this.
    your help is appreciated.

    The following article describes how to create a shared preference file. You can either create preferences that individual users can override, or create locked preferences that individual users cannot override.
    http://kb.mozillazine.org/Lock_Prefs
    (Note: I don't have any personal experience with these files, but another volunteer might post some additional tips and tricks.)

  • *****Please Help Simple Java Corba Problem*****

    This is probably a really simple one but I am very cheased off about it.
    I run my applications on a Win XP pro OS, and when I go to type in nameserv it gives me the following error I hava downloaded and installed JDK 1.4.1. I also have the JRE, And jbuilder personal edition ver 8.....And J2RE 1.4.1
    C:\Documents and Settings\Ash>nameserv
    Exception in thread "main" java.lang.NoClassDefFoundError: java/util/HashSet
    at com.inprise.vbroker.orb.ORB.<init>(ORB.java:81)
    at org.omg.CORBA.ORB.create_impl(ORB.java)
    at org.omg.CORBA.ORB.init(ORB.java)
    at com.inprise.vbroker.naming.ExtFactory.main(ExtFactory.java:126)
    my classpath looks like this
    .;C:\VisualCafePDETrial\BIN\COMPONENTS\SYMBEANS.JAR;C:\VisualCafePDETrial\JAVA\LIB\CLASSES.ZIP;C:\VisualCafePDETrial\JAVA\LIB;C:\BES\bin;C:\j2sdk1.4.1\lib\tools.jar;.;
    and my path is
    C:\VisualCafePDETrial\BIN;C:\VisualCafePDETrial\JAVA\BIN;C:\BES\binC:\j2sdk1.4.1\lib\tools.jar;.;
    what on earth am I doing wrong ??
    Also when I goto compile any java program it comes up with the following
    C:\DOCprac\Prac5\bank_naming>vbmake
    Building the bank_agent example ...
    Exception in thread "main" java.lang.ClassCastException
    at com.visigenic.vbroker.tools.idl2java.main(idl2java.java:30)
    Symantec Java! JustInTime Compiler Version 3.00.021(i) for JDK 1.1.x (TRIAL VER)
    Copyright (C) 1996-98 Symantec Corporation
    compiling: Client.java
    Client.java:2: Package org.omg.CORBA not found in import.
    import org.omg.CORBA.*;
    ^
    Client.java:3: Package org.omg.CosNaming not found in import.
    import org.omg.CosNaming.*;
    ^
    2 errors
    Symantec Java! JustInTime Compiler Version 3.00.021(i) for JDK 1.1.x (TRIAL VER)
    Please help I am really desperate to sort this one out. Can you give me some detailed info on how I would do this.>>>Thanx in advance

    You have 2 sets of errors, at least.
    The first is : Exception in thread "main" java.lang.NoClassDefFoundError: java/util/HashSet which is that you have not imported the class for hashset.
    The second is that the import of the jars is probably wrong, hard to say without seeing code.

  • Printing a hashtable to screen, Server & Client (Java & CORBA)

    Hi all,
    I have written a server method that prints a hashtable's contents to screen:
         public void viewAllEquipment () throws noEquipmentInTable {
              // Does any equipment exist?
              if (equipmentList.isEmpty() == true) {
                   throw new noEquipmentInTable();
              System.out.println("The equipment list is as follows: ");
                    Enumeration tableEntries = equipmentList.keys();
                    int i = 1;
                    while (tableEntries.hasMoreElements()) {        
                    String names = (String) tableEntries.nextElement();
                    System.out.print(i + ". Name = " + names + ", Description = " + equipmentList.get(names));
                    i++;
         }The Client uses simple code to call this method:
    hireCompanyServant.viewAllEquipment();As I'm sure you're probably aware, the Hashtable's contents gets printed to the Server screen not the Client screen! How can I get it printing on the Client instead? I'm unsure whether returning a value via the method would work, and can't think of any other way to do this.
    Any help would be greatly appreciated.
    Thanks
    Edited by: JonBetts2004 on Mar 7, 2008 5:14 AM

    Haha, ok sorry, will do. It's all command-line based, CORBA client-sever model.
    Client: A file/program that implements and calls methods given by the Server.
    Server: A file/program that contains methods that can be called by other clients/servers.
    Screen: command line interface.
    As it is a CORBA implementation, an ORB is started, then the Java Server is started, and finally the Java Client is run in the command prompt, which shows a list of actions to take (add equipment, edit equipment, view equipment, etc).
    Sorry if that's too vague, I find these things hard to explain.
    But basically, the 'client' makes use of the viewAllEquipment method provided by the 'server', which prints the contents of a hashtable to the command line. It is printed to the Server's command line rather than the Client's. I need it printing to the Client's command line, but am unsure what is the best way to approach it. Changing the method from a void to a string, and then returning a value? Or something else?
    thanks

  • Java Corba Problem

    Hi,
    I have a strange Java Client Server application with a corba interface between the two.
    There are three Session Classes that describe this interface.
    The base session is SessionA. Extending that (i.e. :: in IDL) is SessionB and extending that is SessionC.
    The client is broken up into two parts which run in the same JVM. The first part has a dependency to SessionC and the second part has a dependency SessionB. It has to be this way.
    Upon start up the client creates a SessionC everything okay. The client then launches part of the application which only has a dependency to SessionB. To launch this part of the client application a SessionB object must be past. To do this I use the SessionBHelper class and the narrow method.
    Everything works fine no exceptions are thrown.
    Now here is the part that is killing me - when I invoke a method then from the Client to SessionB it throws a Marshalling exception
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No. I check the spec. and there is minor code 0 has a default meaning - i.e. nothing. I have n't a clue what is wrong.
    My only thoughts are that narrow can only be used in down casting. But I could be wrong here.
    I would really appreciate any help or thoughts. Thanks in Advance.

    When ever I come across the most lovely Marshalling exceptions... its usually because my skel/stub classes out of synch with each other (on the client/server)
    When I update the everyone... I usually have everything working and playing nicely.
    This occurs with some frequency using Websphere EJB (using IIOP)... if your client JAR's are not in synch with your server JAR's... then the objects can't be marshalled... its a pain
    ./dave

  • JAVA CORBA CLIENT NO RESOURCE EXCEPTION

    I have developed a simple corba client in java to connect to an IACC server.
    But while initiating a connection to the server I am getting following exception. Please help...
    org.omg.CORBA.NO_RESOURCES: 10.x.x.x:900 in use Minor: 0 (0). Completed: not completed
    at gnu.CORBA.gnuRequest.submit(libgcj.so.7rh)
    at gnu.CORBA.IorDelegate.invoke(libgcj.so.7rh)
    at org.omg.CORBA.portable.ObjectImpl._invoke(libgcj.so.7rh)
    at org.omg.CosNaming._NamingContextExtStub.resolve_str(libgcj.so.7rh)
    at IACCTest.main(IACCTest.java:56)
    Here 10.x.x.x is my own server.
    My client code is:
    import IACC.Server;
    class IACCTest{
          public static void main(String args[]){
            String ip = "170.y.y.y";
            String port = "3075";
            String nameSrv = "IAMDN_ONM";
            Server _mServer=null;
            org.omg.CORBA.Object _obj = null;
         Properties iacc_properties = System.getProperties();
            String iacc_nsref = "corbaloc:iiop:1.2@" + ip +":"+ port +"/NameService";
            iacc_properties.put( "org.omg.CORBA.ORBInitRef", iacc_nsref );
            Sring iacc_name    = nameSrv  +"/"+ "IACC_Server";
            ORB  orb   = ORB.init(args, iacc_properties);
            org.omg.CORBA.Object objRef=null;
            try {
                objRef = orb.resolve_initial_references("NameService");
            } catch (InvalidName ex) {
                ex.printStackTrace();
            NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
            try {
                _obj = ncRef.resolve_str(iacc_name);//At this point the exception is coming
            } catch (CannotProceed ex) {
                ex.printStackTrace();
            } catch (org.omg.CosNaming.NamingContextPackage.InvalidName ex) {
                ex.printStackTrace();
            } catch (NotFound ex) {
                ex.printStackTrace();
            }catch(Exception ex){
                ex.printStackTrace();
            _mServer = ServerHelper.narrow(_obj);
    }Please help me resolve this issue as soon as possible......

    The stacktrace you posted definitely tells me that you're running gij/gcj. You're probably not using the java version you think you are. Try the "java -version" to show which one is run.
    You might want to give the full path to the JDK to ensure you're running the correct version. Or simply uninstall gcj/gij.

  • Packaging my Java CORBA code

    I'm developing a CORBA application using JAVA IDL when I packaged my code in my defined packages I started getting an error when running the client
    ERROR : org.omg.CORBA.BAD_PARAM: minor code: 1398079489 completed: Maybe
    org.omg.CORBA.BAD_PARAM: minor code: 1398079489 completed: Maybe
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at com.sun.corba.se.internal.iiop.ReplyMessage.getSystemException(ReplyMessage.java:93)
    at com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:83)
    at com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:204)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:459)
    at ServiceProvApp._SpStub.processCommand(_SpStub.java:35)
    at SpClient.main(SpClient.java:38)
    This error happens when I try to call a native C code from my application ... can any one help in this please. I have inserted the shared libraries in the proper path and they are loaded properly

    I am getting something very similar does anyone have any idea??????? pls

  • MS Access and Java JDBC help!

    Hello, I having trouble with a java GUI.
    I have a MS Access named Database.mdb with a table named Customer which I want my GUI to access.
    I want my GUI to be able to flick through the records using the field I have made for them.
    I already have connected the database using windows xp's "System DSN" and have no problem creating tables using sql statements in my code
    Who can help me? any information would be great.
    Thanks

    I'm doing an inventory software application too...but my application is an automatic software inventory, is automatic your application??
    My result is the software that are intalled in a machine..is your project too?
    Sorry, my english is not very good...

  • Why the same name of process comes out in AIX , in java. please help me.

    Hello.
    I have two questions related to Jvm.
    I've developed Job scheduler program which is doing somthing as the DB schedule is set in the way of Multi
    thread. Currently , I'm in the process of testing this one. It is good , if in the normal case. However, When
    doing Shell, if the application have so a lot to do the Shell, it has a little problem.
    My developing environment is
    OS : AIX 5.3
    JRE : IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr7-20091214_49398
    (JIT enabled, AOT enabled)
    nofiles(descriptors) 2000
    maxuproc 4096 Maximum number of PROCESSES allowed
    per user True
    In order to execute Shell in My Scheduler program , I tested Runtimeexec() or ProcessBuilder.
    The result of mine in the test , when the executed Shell got over 300 is
         1. The jvm processes that I execute at the first time are shown up , after Shell go to the finish, the
    processes are all in the disappearance again , and at last The processes that I executed at the first time are
    remaining. It's like the process is duplicated process in the maximum of 70.
    When I do shell about 200 to be executed simultaneously, Duplicated jvm about 3 appeared momentarily, then
    disappeared, and also under 120, No duplicated case is found when under 120.
    ps -ef result is below , when shell is excuted
    UID PID PPID C STIME TTY TIME CMD
    jslee 626906 1 0 11, May - 2:20 java -
    DD2_JC_HOME=/source/jslee/JOB -Dfile.encoding=euc-kr jobserver.JobServerMain
    jslee 1421522 626906 0
    19:36:16 - 0:00 java -DD2_JC_HOME=/source/jslee/JOB -Dfile.encoding=euc-kr jobserver.JobServerMain
    ....Skip.....
    jslee 4374620 626906 0 19:34:06 - 0:00 java -DD2_JC_HOME=/source/jslee/JOB -
    Dfile.encoding=euc-kr jobserver.JobServerMain
    (the process list about 60)
    *the first question : Why a lot of duplicated jvm are shown up when in alot of shell to be executed ?
    *the second question : As you can see above , How can I solve out the problem.
    *Is there some option that I can set up when starting Jvm?
    ---Next question---
    My developing environment is
    OS : SunOS 5.8
    JRE : Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
    Java HotSpot(TM) Server
    VM (build 16.0-b13, mixed mode)
    nofiles(descriptors) 256
    As shown obove , the value of descriptors is 256 .
         My scheduler program executed 300 shell at the same time, in result my program was abnormalily
    terminated after doing shell about 180.
    the Exception info is
    java.io.IOException: Cannot run program "sh": error=24, exceeding the number of opened files
         at
    java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at
    java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
    or
    java.net.SocketException: exceeding the number of opened files     at java.net.PlainSocketImpl.socketAccept
    (Native Method)
    &#46608;&#45716;
    java.io.IOException: exceeding the number of opened files     at
    java.io.UnixFileSystem.createFileExclusively(Native Method)
         at java.io.File.checkAndCreate(Unknown
    Source)
         at java.io.File.createTempFile(Unknown Source)
    *question : If I continuously request to open a file that go over system limit, is it possible for JVM to be
    terminated?
    *question : Is there a method that obtains state of System limit in the java library.
    *question : what is the best solution to cope with ?
    Please help me
    =

    struts-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      <form-beans>
           <form-bean name="registrationForm" type="ndlinh.struts.lab.RegistrationForm" />
      </form-beans>
      <action-mappings>
           <action path="/register"
                   type="ndlinh.struts.lab.RegistrationAction" // action class
                   name="registrationForm" // form bean name
                   validate="false"
                   scope="request"
                   input="registration.jsp" >
                <forward name="success" path="/jsp/success.jsp"  />
                <forward name="failure" path="/jsp/failure.jsp"  />
           </action>
      </action-mappings>
    </struts-config>HTH

  • Pricing : ABAP to Java conversion help needed

    Hi all.
    I am basically an ABAP developer. My recent assignment needs some java coding.
    It will be very helpful if we anybody helps me in finding the corresponding pricing fields in java.
    The abap code is as follows
    check : xkomv - kgrpe  = '  '.
    check: xkomv - xkbetr ne 0.
    check : komp - kpein ne 0.
    if komp - netwr < 0.
      komp - netpr = 0 - komp - netpr.
    endif.
    xkwert  = (        (  ( komp - netpr * ( 100000 + xkomv - xkbetr))     / 100000)
    komp-mglme / komp-kumza * komp - kumne / 1000 / komp - kpein )
      - komp-netwr.
    Please help in converting this abap code to its corresponding java code.
    Thanks and Regards
    Deepika

    Here is the code I have developed: Please check and let me know if there are any changes
    import java.math.BigDecimal;
    import com.sap.spe.pricing.customizing.PricingCustomizingConstants;
    import com.sap.spe.pricing.transactiondata.PricingTransactiondataConstants;
    import com.sap.spe.pricing.transactiondata.userexit.IPricingConditionUserExit;
    import com.sap.spe.pricing.transactiondata.userexit.IPricingItemUserExit;
    import com.sap.spe.pricing.transactiondata.userexit.ValueFormulaAdapter;
    public class ZS2S_IPC_ZDCP extends ValueFormulaAdapter {
          public BigDecimal overwriteConditionValue(
                IPricingItemUserExit item,
                IPricingConditionUserExit condition) {
                BigDecimal kompKumza = new BigDecimal(String.valueOf(condition.getFraction().getNumerator()));
                BigDecimal kompKumne = new BigDecimal(String.valueOf(condition.getFraction().getDenominator()));
                boolean xkomvKgrpe = condition.isGroupCondition();
                BigDecimal kompKpein = condition.getPricingUnit().getValue();    
                BigDecimal kompNetwr  = item.getNetValue().getValue();
                BigDecimal kompNetpr  = item.getNetPrice().getValue();
                BigDecimal xkomvKbetr = condition.getConditionRate().getValue();
                BigDecimal kompMglme = item.getBaseQuantity().getValue();
                  if ( xkomvKgrpe = true )
                      return PricingTransactiondataConstants.ZERO;
                  if ( kompKumza != PricingTransactiondataConstants.ZERO )
                    return PricingTransactiondataConstants.ZERO;
                if ( kompKumne != PricingTransactiondataConstants.ZERO )
                      return PricingTransactiondataConstants.ZERO;   
                if ( kompKpein != PricingTransactiondataConstants.ZERO )
                        return PricingTransactiondataConstants.ZERO;
                if (kompNetwr.compareTo(PricingTransactiondataConstants.ZERO) < 0 )
                      kompNetpr = (PricingTransactiondataConstants.ZERO).subtract(kompNetwr);
                 BigDecimal y = new BigDecimal("100000");
                BigDecimal a = y.add(xkomvKbetr);
                BigDecimal temp = kompNetpr.multiply(a);
                BigDecimal result1 = temp.divide(y, 2, BigDecimal.ROUND_HALF_UP);
                BigDecimal result2 = result1.multiply(kompMglme)
                                         .divide(kompKumza, 2 BigDecimal.ROUND_HALF_UP).multiply(kompKumne).divide(kompKpein, 2,  BigDecimal.ROUND_HALF_UP);
                BigDecimal Result = result2.subtract(kompNetwr);
              return Result;
    Edited by: Deepika Mallya on Aug 6, 2009 9:08 AM

Maybe you are looking for