Compile example Problems

Hi,
I have installed on Fedora Core 8 with successfull Oracle JRockit Real Time 3.0 and Oracle CEP Release 11gR1.
I have set JAVA_HOME to JRockit Home (..../jrmc-3.1.0...) and add the bin to PATH.
If I try to execute Helloword example, it works fine.
If I try to compile Helloword example with Ant I receive following error :
[javac] Compiling 3 source files to /home/Oracle/Middleware/ocep_11.1/samples/source/applications/helloworld/output
[javac] ----------
[javac] 1. ERROR in /homet/Oracle/Middleware/ocep_11.1/samples/source/applications/helloworld/src/com/bea/wlevs/adapter/example/helloworld/HelloWorldAdapter.java (at line 1)
[javac] /* (c) 2006-2009 Oracle. All rights reserved. */
[javac] ^
[javac] The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
[javac] ----------
[javac] 2. ERROR in /home/Oracle/Middleware/ocep_11.1/samples/source/applications/helloworld/src/com/bea/wle
[javac] vs/adapter/example/helloworld/HelloWorldAdapter.java (at line 4)
[javac] import java.text.DateFormat;
[javac] ^^^^^^^^^
[javac] The import java.text cannot be resolved
[javac] ----------
and others of same type. (Total 31)
Someone can help me!
Thanks.

The antfiles for the samples do not do anything other than add the build directories to the classpath. So I think you need to make sure that your PATH environment variable points to the correct version of the java installation that you need.
The pre-built samples are fixed at installation time to point to the installed JDK.

Similar Messages

  • Is anybody has the example problem for AD/DA converter controled by PIC16F84?

    In my circuit( Multisim 9), I use PIC16F84 as the
    MCU to control the DAC and ADC. I want to ask if anyone has the example
    problem for the controlling?
    Further more, the I/O port of
    PIC16F84 seems can not be connected with the digital output of DAC, so
    I asked myself, is it right that for PIC16F84, the I/O port can only
    connected with the serial port of DAC and ADC? Or it needs a converter
    to adapt to the  input  port of DAC?
    Looking for any help! Thanks!

    You can test the new Design Circuit Suite (includes Multisim10 with MCU10 and Ultiboard 10 with Ultiroute10). When you open Samples you find the folder MCU with PIC folder. In these you can find some examples to PIC16F84. With that as pattern you should solve the problem.
    I attached you here the MCU examples in the *.zip
    For downloading the 30 days free test version you can use the link:
    http://www.ni.com/academic/multisim/ and click to evaluation software
    or these link:
    https://sine.ni.com/apps/utf8/nigb.confirm?p_gb_prof_id=7350&p_lang=US&p_dl_url=&p_dwnld=N&p_code=GB...
    Attachments:
    MCUPicScreenshot.zip ‏964 KB

  • Problem when compiling example from TechEd 2008

    Hi,
    I' am using sap sneak preview 7.01 and I'm trying to compile the ZMHO_EX3_*  webdynpro example.
    I get the error :
    "syntax error : long text".
    When I check the syntax I have allways the same error :
    Field ")" is unknown...
    each time the source code follow this structure :
    wd_this->mr_message_manager = wd_this->wd_get_api ( )->get_message_manager( ).
    All the attributes of the assistance class ZCL_MHO_WD_SERVICE are red highlight.
    I need to use FlashIsland to create mockups for a ramp up client, can you help me to solve this this problem ?
    Thanks,
    Regards

    Hi,
    thank you very much for answering me so quickly, I really appreciate this.
    I'have already try to fix the problem by splitting the line code, but it doesn't work.
    I paste bellow my piece of code, it is located in the method wdoinit of the component controller
    METHOD wdoinit .
    data l_api type ref to if_componentcontroller .
    l_api = wd_this->wd_get_api( ) .
    wd_this->mr_message_manager = l_api->get_message_manager( ) .
    wd_this->init_new_record( so_id = '00000000005000000010' ) .
    wd_this->read_products( ) .
    ENDMETHOD.
    I get the following error :
    The result type of the function method cannot be converted into the type of l_api type of l_api.
    Instead of if_componentcontroller I tried ig_componentcontroller too, but it doesn't work too.
    The long text error at the origin of my post as a lot of occurences in the syntax error window when I check this application: about 10 errors with the same origin.
    All attributes of the assistance class ZCL_MHO_WD_SERVICE are allways displayed in red, is it normal ?
    Have I to setup/upgrade something on my system in order it will work ?
    (There is a lot of errors, since is there a global solution to fix it in one shoot ?)
    Thank you,
    Regards.

  • Problem compiling example

    Hi,
    I am using MS Visual Studio .NET and NI 488.2 examples (not NIDAQ) and it gives me this message:
    "fatal error C1010: unexpected end of file while looking for precompiled header directive"
    what does it mean?
    Anyone can answer me?
    Thaks,
    Leo

    check this other thread out.
    AlessioD

  • Compile examples

    Hi,
    i have win2000 server and i can't compile the insurance examples .java files.
    I think is an eviroment problem. Is there someone who tell me how setting up my enviroment and how i have to compile these files?
    Thanx, ****

    Darrin,
    i followed all instructions to set up the the correct enviroment variables but when i try to compile .java files with javac compiler, it tells me that it can't find class sun/tools/javac/Mani class.
    Maybe win2000 server can't see the variables setted so i have to do something that makes the variables visible.
    hi.

  • OpenMPI compile/link problems [SOLVED]

    After installing openmpi 1.6-2, I tried compiling a well-tested mpi program that
    I have been running under lam mpi on Debian linux.  Attempting to compile on
    Arch openmpi results in missing libraries:
    swallow:~/svn/conv/trunk$ make
    mpicc -g -c main.c
    mpicc -g -c timestep.c
    mpicc -g -c thermo.c
    mpicc -g -c toyrad.c
    mpicc -g -c getprofile.c
    mpicc -g -o conv main.o timestep.o thermo.o toyrad.o \
    getprofile.o -lcdf -lm
    main.o: In function `main':
    /home/raymond/svn/conv/trunk/main.c:157: undefined reference to `lam_mpi_comm_world'
    /home/raymond/svn/conv/trunk/main.c:158: undefined reference to `lam_mpi_comm_world'
    /home/raymond/svn/conv/trunk/main.c:187: undefined reference to `lam_mpi_comm_world'
    /home/raymond/svn/conv/trunk/main.c:189: undefined reference to `lam_mpi_comm_world'
    /home/raymond/svn/conv/trunk/main.c:629: undefined reference to `lam_mpi_sum'
    collect2: error: ld returned 1 exit status
    make: *** [conv] Error 1
    swallow:~/svn/conv/trunk$
    I then downloaded the openmpi package from the OpenMPI website, compiled it myself,
    and installed it in /usr/local.  I was able to compile and run the program with no trouble.
    (The --prefix /usr/local flag was needed on mpirun.)
    I notice that the openmpi libraries have been moved to /usr/lib/openmpi/ in the Arch version.
    Presumably Arch openmpi would work if one told the system where the libraries were (I haven't
    tried it), but relocating the libraries seems like an unnecessary complication to me and a
    booby trap for the unwary.
    Last edited by djraymondnm (2012-09-11 12:57:18)

    Compilation of C code works for me. The location of the libs should not be a problem because the linker find them with the following file :
        $ cat  /etc/ld.so.conf.d/openmpi.conf
        /usr/lib/openmpi
    I just pushed openmpi-1.6.1 in [extra]. Let me know if it works for you. If not, could you please give me a minimal example that does not compile for you ?
    Last edited by stephane (2012-09-04 23:10:17)

  • Axis Example problem (CLASSPATH-related ?)

    Hi
    I am trying to deploy the example5 BeanSerializer example (after successfully completing exercises 1-4). I am running the following command from the samples/userguide/example5 directory:
    c:>java org.apache.axis.client.AdminClient -llocal:///AdminService deploy.wsdd
    This produces the following non-fatal error:
    SEVERE: Unable to deploy typemapping: {urn:BeanService}Order
    java.lang.ClassNotFoundException: samples.userguide.example5.Order
    I have "." in my CLASSPATH. The compiled .class files have been placed in the tomcat\webapps\axis\WEB-INF\classes\samples\userguide\example5\ folder. But the deployer is unable to locate the Order.class file.
    Any clue would be helpful. TIA.
    Sierra Bravo

    Hello All,
    I am having the same kind of problem. I can compile the samples but I cannot run them. As a result, I could not even install the sample webservices.
    Here's my description...
    I do not know if this is a Java environment problem or my Axis environment problem. So bear with me. I am having difficulty executing the samples that came with Axis 1.4.
    I know that my Java environment is OK because I had no problems compiling and executing the included Java JDK samples.
    Platform:
    =========
    Windows XP, SP2
    Apached Http Server 2.2 [installed at C:\wtSoftware\Apache2.2]
    Tomcat 5.5.17 [installed at C:\wtSoftware\Tomcat5.5]
    Axis 1.4 [installed at C:\wtSoftware\Tomcat5.5\webapps\axis]
    Sun jdk1.5.0_08 [installed at C:\wtSoftware\jdk1.5.0_08]
    copied JAF 1.1 JAR to AXIS_LIB
    copied tools.jar to AXIS_LIB
    copied JavaMail 1.4 to AXIS_LIB
    copied Xerces 2.8.0 to AXIS_LIB
    copied XML Security 1.3.0 to AXIS_LIB
    AXIS_HOME=C:\wtSoftware\Tomcat5.5\webapps\axis
    AXIS_LIB=%AXIS_HOME%\WEB-INF\lib
    AXISCLASSPATH=%AXIS_LIB%\axis.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\xercesImpl.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\wsdl4j-1.5.1.jar;%AXIS_LIB%\axis-ant.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\mail.jar;%AXIS_LIB%\resolver.jar;%AXIS_LIB%\serializer.jar;%AXIS_LIB%\xalan.jar;%AXIS_LIB%\xmlsec-1.3.0.jar;%AXIS_LIB%\activation.jar;%AXIS_LIB%\tools.jar;
    CLASSPATH=%AXISCLASSPATH%
    I have correctly installed Axis as per the documentation and all pages work.
    When I tried to run the example as specified in the Axis User Guide, I would get an exception. The following is the command I used:
    java -verbose -cp "%CLASSPATH%" samples.userguide.example1.TestClient
    [Loaded java.io.BufferedReader from shared objects file]
    [Loaded java.io.InputStreamReader from shared objects file]
    [Loaded sun.nio.cs.StreamDecoder from shared objects file]
    [Loaded sun.nio.cs.StreamDecoder$CharsetSD from shared objects file]
    [Loaded java.util.AbstractSequentialList from shared objects file]
    [Loaded java.util.Queue from shared objects file]
    [Loaded java.util.LinkedList from shared objects file]
    [Loaded java.util.LinkedList$Entry from shared objects file]
    [Loaded java.io.IOException from shared objects file]
    [Loaded java.io.FileNotFoundException from shared objects file]
    Exception in thread "main" java.lang.NoClassDefFoundError: samples/userguide/example1/TestClient
    [Loaded java.lang.Shutdown from shared objects file]
    [Loaded java.lang.Shutdown$Lock from shared objects file]
    i have also tried to add all JAR files from the JDK into the CLASSPATH and still I would get an exception when running the class. Although the exception would be FileNotFoundException for another class.
    Any help would be greatly appreciated.
    Thanks

  • Compiler locking problem

    Hello
    When I compile C++ programs I get the following error:
    SunWS_cache: Error: Lock attempt failed for /srsuser/seers/srs/bin/solaris8/Sun
    S_cache/CC_state (errno: 45). Aborting....
    Environment:
    Sun WorkShop(TM) Release 6 update 1
    SunOS ****** 5.8 Generic_108528-11 sun4u sparc SUNW,Sun-Fire-280R
    I have tried some obvious things such as deleting the lock file and changing the permissions on the files and the cache directory.
    Can anybody suggest a workaround or a solution?
    Thanks.
    John Sers

    Hello Rose
    Thank you for taking the time to reply.
    I have posted below an example of the failure. I have tried many combinations of parameters and options to try an isolate the problem but no success. This example is single user - that is it is not a shared cache with multiple users or multiple compiles.
    Also since I posted this topic we have installed a patch (111685-05) on Solaris but that has not fixed the problem. The problem is intermittent - in that occasionally (very occasionally) I can compile successfully.
    Regards.
    John Seers
    CC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -KPIC -features=no%conststrings -D_REENTRANT -D_MULTITHREADING -mt -pta -DRDBORACLE -DSRSRDB -I/srsuser/seers/srs/bin/solaris8 -I/srsuser/seers/srs/gd -I/srsuser/seers/srs/zlib -I/srsuser/seers/srs/ctree/include -I/srsuser/seers/srs/ctree/source/sunos5.unx -I/srsuser/seers/srs/jtc/solaris/include -I/srsuser/seers/srs/src -I/localdata/home/oracle/9.0.1.1/precomp/public -I/localdata/home/oracle/9.0.1.1/rdbms/demo -I/localdata/home/oracle/9.0.1.1/network/public -I/localdata/home/oracle/9.0.1.1/rdbms/public -o /srsuser/seers/srs/bin/solaris8/msgdef /srsuser/seers/srs/bin/solaris8/msgdef.o /srsuser/seers/srs/bin/solaris8/Monitor.o -lposix4 -lpthread
    SunWS_cache: Error: Lock attempt failed for /srsuser/seers/srs/bin/solaris8/SunWS_cache/CC_state (errno: 45). Aborting....

  • SAXParseException while compiling  example files provided with JAXB

    compile:
    [echo] Compiling the schema...
    [xjc] Compiling file:/C:/jaxbnew/jaxb-1.0-beta/examples/users-guide/Sample
    App1/po.xsd
    [xjc] org.xml.sax.SAXParseException: Unexpected </xs:restriction> appears
    at line 17 column 22
    [xjc] at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.unexpectedXXX(NGCC
    RuntimeEx.java:323)
    [xjc] at com.sun.xml.xsom.impl.parser.state.NGCCHandler.unexpectedLeav
    eElement(NGCCHandler.java:81)
    [xjc] at com.sun.xml.xsom.impl.parser.state.SimpleType_Restriction.lea
    veElement(SimpleType_Restriction.java:159)
    [xjc] at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGC
    CRuntime.java:250)
    [xjc] at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.ja
    va:595)
    [xjc] at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.ja
    va:595)
    [xjc] at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.ja
    va:595)
    [xjc] at org.iso_relax.verifier.impl.VerifierFilterImpl.endElement(Unk
    nown Source)
    [xjc] at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknow
    n Source)
    [xjc] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElemen
    t(Unknown Source)
    [xjc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen
    tContentDispatcher.dispatch(Unknown Source)
    [xjc] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc
    ument(Unknown Source)
    [xjc] at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Sour
    ce)
    [xjc] at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Sour
    ce)
    [xjc] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    [xjc] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
    rce)
    [xjc] at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:37
    1)
    [xjc] at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:37
    1)
    [xjc] at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:37
    1)
    [xjc] at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRu
    ntimeEx.java:151)
    [xjc] at com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java
    :116)
    [xjc] at com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java
    :113)
    [xjc] at com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java
    :110)
    [xjc] at com.sun.xml.xsom.impl.parser.XSOMParser.<init>(XSOMParser.jav
    a:87)
    [xjc] at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476
    [xjc] at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
    [xjc] at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
    [xjc] at org.apache.tools.ant.Task.perform(Task.java:319)
    [xjc] at org.apache.tools.ant.Target.execute(Target.java:309)
    [xjc] at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [xjc] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    [xjc] at org.apache.tools.ant.Project.executeTargets(Project.java:1250
    [xjc] at org.apache.tools.ant.Main.runBuild(Main.java:610)
    [xjc] at org.apache.tools.ant.Main.start(Main.java:196)
    [xjc] at org.apache.tools.ant.Main.main(Main.java:235)
    BUILD FAILED
    java.lang.InternalError
    at com.sun.xml.xsom.impl.parser.XSOMParser.<init>(XSOMParser.java:99)
    at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
    at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
    at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
    at org.apache.tools.ant.Task.perform(Task.java:319)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
    at org.apache.tools.ant.Main.runBuild(Main.java:610)
    at org.apache.tools.ant.Main.start(Main.java:196)
    at org.apache.tools.ant.Main.main(Main.java:235)
    Total time: 4 seconds
    java.lang.InternalError
    at com.sun.xml.xsom.impl.parser.XSOMParser.<init>(XSOMParser.java:99)
    at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:476)
    at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
    at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
    at org.apache.tools.ant.Task.perform(Task.java:319)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
    at org.apache.tools.ant.Main.runBuild(Main.java:610)
    at org.apache.tools.ant.Main.start(Main.java:196)
    at org.apache.tools.ant.Main.main(Main.java:235)

    Make sure you are using the same version of Xerces in ant, tomcat, jaxb and java (endorsed folder). Preferably 2.2.1. Still, for some reason I cannot make it work under Tomcat 4.1.12, works fine whenever my app is run outside tomcat, but if I run it in tomcat, it doesn't recognize the XML document as it was defined in the schema (especifically the attributes). I have posted the question but no answers yet.
    I had your problem, and checked what I was doing and had different versions of Xerces, one packaged with JVM 1.4.1_01, another with Ant 1.5, another with tomcat and yet another one used in my app. Just downloaded the latest version, replaced all instances of xercesImpl.jar, xalan.jar (if you are using it), xmlParsersAPI.jar and xsltc.jar (if using latest v. of xalan) everywhere and it worked fine, compiles fine and runs fine (outside of tomcat). Make sure you copy them in your endorsed folder (inside the jre/lib folder of your java installation).
    In any case, if you run the JVM with the parameter -verbose:class you will be able to see from where the DOM and SAX classes are being loaded.

  • Compile / run problems with netbeans 6 but not netbeans 6 beta 1 or 5.5

    When I compile my project in netbeans IDE 6.0 (Build 200711261600) 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 i get quite often a "can not find symbol" error or during runtime a "netbeans 6 java.lang.NoClassDefFoundError" exception. also switching between F6 or ctrl-F5 mode can cause the problem to appear.
    Compiling again or clean build resolves it.
    However running the same project under netbeans 5.5 or 6 beta 1 never gives this problem.
    any hint what might be wrong? i looked and compared the project settings but can't see any difference, but I assume that the upgrade script must have changed something.

    <?xml version="1.0" encoding="UTF-8" ?>
    - <project name="BorderDemo" default="default" basedir=".">
    <import file="nbproject/build-impl.xml" />
    </project>This is 'build.xml' file. Check for 'project.xml' file in 'nbproject' folder. You will find it to be:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <project xmlns="http://www.netbeans.org/ns/project/1">
      <type>org.netbeans.modules.java.j2seproject</type>
    - <configuration>
    - <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
      <name>BorderDemo</name>
      <minimum-ant-version>1.6.5</minimum-ant-version>
    - <source-roots>
      <root id="src.dir" />
      </source-roots>
      </data>
      </configuration>
      </project>Change it to:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <project xmlns="http://www.netbeans.org/ns/project/1">
      <type>org.netbeans.modules.java.j2seproject</type>
    - <configuration>
    - <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
      <name>BorderDemo</name>
      <minimum-ant-version>1.6.5</minimum-ant-version>
    - <source-roots>
      <root id="src.dir" />
      </source-roots>
      <test-roots>
      <root id="test.src.dir" />
      </test-roots>
      </data>
      </configuration>
      </project>I hope it works.....
    thanks!

  • Oracle BPM - Expense Management Example problem

    Hi,
    I have just started to explore Oracle BPM Version 10.3.2 and I am trying to execute the Expense Management Project as given in the starters documentation.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/tutorial/index.html
    After deploying the process and going into the workspace using
    http://localhost:8585/workspace
    I am not getting anything listed in the Applications tab. It is showing the following error:-
    Could not retrievePrincipal applications for process '/ExpenseReporting'.
    I searched in this same forum and came across this post:-
    Re: Why there is no application in workspace?
    which says that it may be due to version conflicts or some error coming up in the problems tab.
    I checked my problems tab but it is not showing anything.
    Eliminating this I thought it may be due to version conflicts (as i am following the post) so I uninstalled all my JDK's and just installed jdk 1.6 update 21 but still I got the same problem - i think this solved the issue for some users (Satya Anareddy)
    Then in one comment in the same post given by Dan (Daniel Atwood ) i tried using the default 1.5 JM.
    But still I am getting the same error.
    I am completely confused as to what the problem could be.
    Please could anyone give me some directions.
    Thanks,
    Rohit
    Edited by: 801493 on Oct 11, 2010 6:02 AM
    Edited by: 801493 on Oct 11, 2010 6:03 AM

    Please follow this step may this solve your problem.
    please modify any thing in process "ExpenseReporting" for example any transition or any activity to place some where else or any other modification and then save that process. Then clean the project and build and deploy it.
    if this also not solve the problem then export that project to and import it again in your workspace (Create new workspace or change the project name in same workspace ) and then again clean, build and deploy the application then test in work space.
    Thanks,
    Brijesh Kumar Singh

  • Beginner running RMI example problem

    I am trying to test this RMI code from Thinking in java and it is giving this error
    Exception in thread "main" java.lang.NoClassDefFoundError: DispatchPerfectTime (
    wrong name: project3/rmi/DispatchPerfectTime)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    6)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
    I compiled the 3 files below and also called rmic and created a stub and skeleton..... Only it doesnt run..
    Any ideas why ?
    INTERFACE
    package project3.rmi;
    import java.rmi.*;
    interface PerfectTimeI extends Remote
         long getPerfectTime() throws RemoteException;
    }Implementation of Remote interface
    package project3.rmi;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.net.*;
    public class PerfectTime extends UnicastRemoteObject implements PerfectTimeI
         public long getPerfectTime() throws RemoteException
              return System.currentTimeMillis();
         //constructor to throw remote exceptions
         public PerfectTime() throws RemoteException
              //super(); called automatically
         //register for rmi server
         public static void main(String args[]) throws Exception
              LocateRegistry.createRegistry(2005);
              System.setSecurityManager(new RMISecurityManager());
              PerfectTime pt = new PerfectTime();
         Naming.rebind("//200.23.23.2:2005/PerfectTime",pt); //I put dummy IP instead of my real IP
              System.out.println("Ready to do time");
    }USING REMOTE OBJECT
    /**Using the remote object**/
    package project3.rmi;
    import java.rmi.*;
    public class DispatchPerfectTime
         public static void main(String args[]) throws Exception
              System.setSecurityManager(new RMISecurityManager());
              PerfectTimeI t = (PerfectTime)Naming.lookup("//200.23.23.2:2005/PerfectTime");
              for(int i =0;i<10;i++)
              System.out.println("Perfect Time is "+t.getPerfectTime());
    }

    I am just using another RMI example from class now...
    All files are compiling but this is error.....
    C:\>java -classpath c:\ RMIServer
    Starting Server
    Started Server...
    Binding to RMI Registry
    Error RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: RMIServer_Stub
    I doono if my host is correct...... I donno what to write in place of test... its some service??
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    public class RMIServer extends UnicastRemoteObject implements RMIInterface
      static String host = "rmi://IPAddress/test";
      static String data[] = {"c","c++","java"};
      public RMIServer() throws RemoteException
                super();
      //implement methods
      public int getNumData() throws RemoteException
                return data.length;
      public String getData(int index) throws RemoteException
              if(index>=0 && index<data.length)
                   return data[index];
              else
                   return "N/A";
      public static void main(String args[])
           RMIServer server;
           try{
                System.out.println("Starting Server");
                server = new RMIServer();
                System.out.println("Started Server...");
                  System.out.println("Binding to RMI Registry");
                Naming.rebind(host,server);
                System.out.println("Remote methods registered successfully");
           catch(Exception e){
                System.out.println("Error "+e.getMessage());
      }//main
    } //class

  • Compiling packages problem???

    Thanks for checking this out, noticed there hadn't been a similar compiling question for
    at least 40 pages, so figured I should contribute!!
    I am trying to compile a package class with six other classes added as part of the
    same package and instantiated withing tabbed panes within the first class.
    info
    JDK: j2sdk1.4.0-beta3
    path: path=c:\windows;c:\windows;c:\windows\command\j2sdk1.4.0-beta3\bin
    Folder/directory : c:\Divelog
    javac is accessed by: c:\j2sdk1.4.0-beta3\bin\javac
    package: divelog
    file: DiveLog.java
    -public class DiveLog extends JFrame
    six other files are Welcome.java, Diver.java, Dives.java, Statistics.java, Website.java,
    Resources.java
    -all are started with the package divelog; declaration
    - all are called within a populateTabbedPane() in the DiveLog file and class.
    all .java files can be seen when I enter c:\Divelog>dir
    problem:
    entering c:\j2sdk1.4.0-beta3\bin\javac DiveLog.java
    returns six errors of type : cannot resolve symbol
    symbol: class Welcome
    location: class divelog.Divelog
    new Welcome
    I understand that this is not the way to compile a package so tryed lots of different
    things as suggested by the troubleshooting tutorial, the most effective are
    c:\j2sdk1.4.0-beta3\bin\javac -classpath c:\Divelog.divelog.java
    " \javac -classpath c:\Divelog.divelog
    \javac -classpath c:\Divelog
    all of these pause for about 5 seconds then returns to the c:\Divelog> (as if there
    were no errors)
    enter dir to see if they have been compiled, and there is no .class versions of these
    files.
    entering
    c:\j2sdk1.4.0-beta3\bin\javac -classpath c:\Divelog\ DiveLog.java or \ Divelog or \
    Divelog.DiveLog
    (with the space after the \ ) returns the six error messages above.
    I am positive there is something very simple I am missing, could someone please help
    me out, It would be greatly appreciated, I really like this java programming, but when
    you run into a hurdle like this, It gets very frustrating. Thanks alot in advance!!!

    Thanks alot eric, I spent about 15 hours trying to work that out. Tthat helped alot I have a couple of quick follow up questions
    1. in the classpath \divelog/*.java what does the /*.java do is that the call for the entirity of the divelog
    package.
    2. all of the six sub classes (welcome, Resources, etc) all compiled and are now in the directory of the
    c:\Divelog>
    except that the main class/file DiveLog will not itself, and is not listed as a DiveLog.class,
    there is still only a DiveLog.java even thought the others in the package all have become .class.
    Is there any way I can compile this one file on it's own, or how do I get it to compile into a .class file??
    3. to run the application would I then enter
    c:\Divelog>c:\j2sdk1.4.0-beta3\bin\java -classpath \divelog.?
    Once again, I really appreciate your help, that was great!

  • Possible compiler/FB Problem?

    I just upgraded to FB 2.0.1. After having to deinstall and
    reimport my project due to issues with the old project, I now have
    a very strange issue.
    When FB compiles and it detects an error,the Problems tab
    shows a description of the problem, but does not show the name of
    the file under "Resource" or anything in the "In Folder" columns.
    It shows a line number, but that really doesn't do me any good
    since I don't know what file its in and I can't double-click or use
    the GO TO to find the error. Due to problems upgrading, I've had to
    import multiple files and it just tells me the problem, but no
    location.
    Any thoughts? This is driving me crazy.
    Thanks,
    Tom

    Thanks for the tip, but it was a bit more involved for me.
    All the normal attempts to resolve the issue didn't work
    including cleaning the project, recreating the project, and even
    reinstalling Flex Builder (w/2.0.1). Finally, the only thing that
    resolved it was deleting all of the files and rebuilding my source
    code from SVN.
    Have a good night!
    Michael
    http://michael.omnicypher.com/2007/01/wheres-problem.html

  • LabVIEW example problem

    i have install labview 7.1 development software with driver , on windows xp
    i am not able to open example . it shows following errors "CAN NOT FIND LabVIEW SERVICE PORT FROM SERVICE LOCATER YOU WILL BOT BE ABLE TO BROWS DIRECTRY STRUCTRY" while when i make any programme it works
    please help to solve this problem
    thanks
    R.R.YADAV
    [email protected]

    Hi,
    LabVIEW Example Finder uses NI Service Locator in the background. Try to restart the Service Locator and see if that helps. More information on this can be found at the following link.
    http://digital.ni.com/public.nsf/websearch/8C00F1144B2CD73E86256DEF00698AC3?OpenDocument
    Also, make sure that there is no antivirus or firewall application running in the background when you try to open the example.
    Regards,
    Ankita A.

Maybe you are looking for

  • Can i password protect pages in iweb?

    id like to be able to do it with a username and password that i can issue to select people..

  • File Names in PSE 10 Organizer

    How can I get the file names of photos to display on each image in the organizer without having to go to show properties?

  • Inserts are slow if table have lots of record (400K) vs. if it's empty

    It takes 1 minute to insert 100,000 records into a table. But if the table already contains some records (400K), then it takes 4 minutes and 12 seconds; also CPU-wait jumps up and "Free Buffer Waits" become really high (from dbconsole). Do you know w

  • Customer Master - Customer Category

    Hi All, Customer Master having a field called Customer Category, Presently its having 2 records, I would like to add a new record in that. As i checked lookup forms, there is no category, but when i check the below query its showing 2 records like (C

  • How to start with Camera Raw (basics)

    Hi, I'm a beginner.....in ACR.... camera: Panasonic DMC FZ8. What steps must I do to begin editing images in ACR? for example: - What you see is what you get....... - adjusting colors for monitor en images to see what I get.... color difference betwe