Binary class definition not found: Hello  --- When access the sample

Hi,
I followed the the document of
Oracle9iAS Release 2 Containers for J2ee
dated 12/01/01
to deploy the stateless pure java web service, Hello.
When I hit
http://server:port/hellows/helloService?wsdl
I got the generated WSDL
Also, I can get the proxy class source and jar from
http://server:port/hellows/helloService?proxy_jar
http://server:port/hellows/helloService?proxy_source
However, after I compiled HelloClient and HelloProxy, I got the following error when I tried to access the web service, Hello
Any advice is appreciated.
Qiming
[SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type "text/html", must be: "text/xml". Response was:
<HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD><BODY><H1>500 Internal Server Error</H1><PRE>oracle.j2ee.xanadu.JasperGenerationError: no source generated during code generation!: 1 in getFile name: \Hello.class
<br>1 in getFile name: \Hello.java
<br>error: error message &apos;class.format&apos; not found<br>binary class definition not found: Hello
<br>
<br>     at oracle.j2ee.ws.JavaWrapperGenerator.generate(JavaWrapperGenerator.java:267)
<br>     at oracle.j2ee.ws.RpcWebService.generateWrapperClass(RpcWebService.java:668)
<br>     a[i]Long postings are being truncated to ~1 kB at this time.

You may want to try the latest and greatest OC4J 9.0.3 which is on OTN at:
OC4J 9.0.3: http://otn.oracle.com/software/htdocs/devlic.html?/software/products/ias/htdocs/utilsoft.html
The updated Web service writeups are in:
<oc4j_home>\webservices\demo\demo.zip (unzip and look in the <demo_unzip>\basic\java_services\README.txt)
One thing that might cause your problem is making sure your class path is updated to point to all the right class files as described in the writeup, including the jar file containing the downloaded class files.
Mike.

Similar Messages

  • Page Not Found error when accessing the Identity server console

    Hi,
    I have installed the Sun One Portal Server.
    when i access the URL for Identity server, i am getting Page not Found exception.
    Any suggestions, why this problem could occur.
    Regards,
    Mukta

    First the obvious: Restart the Webserver/Application Server
    Did you choose "Configure Later"?
    Is amconsole/amserver/... really deployed? You can see this in the Admin web interface of the server.
    Do you see anything in the logfiles?
    Chris

  • Class definition not found

    Hi
    I am getting an error with the message ' xml token writer ' class definition not found.May you please provide the API that I should use to make this class available..
    Thanks in advance,
    Sudeep.

    Hi ,
      I have created an application which accepts a user request for data transfer  from a source system to target system viz. Primavera project planner and SAP project system.
    The application verifies the data on the source and target system before actually transferring data.The info is displayed to the user and only when the user clicks transfer button is the data transferred.
    When the data size is small,the transferred successfully.
    However , when data size is large, the application gives XML Token Writer Class not found exception.
    Thanks in advance.

  • Class not found Exception when accessing database through java using ASP

    I am trying to access the database through ASP via java:
    the database is setup as a system database..
    the java class works fine if i try to run it as a stand alone.. but as soon as I run it through ASP.. it does not get passed the driver line.. is there anything in particular I need to do ?
    JAVA and ASP and the output code looks like as follows:
    java code looks like this:
    import java.sql.*;
    public class testDB{
    private Connection connection;
    private Statement statement;
    public static void main(String[] args){
    public String getDriver(){
    String x = "start of program ";     
    try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              x = x + " Got Driver";
              connection = java.sql.DriverManager.getConnection("jdbc:odbc:database", "sunny", "jassal");
              x = x + " After connection statement";
              statement = connection.createStatement();
              x = x + " After statement statement";
              statement.execute("Insert into name (name, age) values ('hello', 33)");
              x = x + " after insert";
              connection.close();
         } catch (Exception sqlex){x = x + sqlex.getMessage() + " " ;
              x = x + sqlex.toString() + " " ;
              x = x + sqlex.getLocalizedMessage();}
    return x;
    and the asp looks like this:
    <html>
    <%
         set javaobject = GetObject("java:testDB")
         response.write "after getting object"
         response.write javaobject.getDriver()
         set javaobject = nothing
    %>
    </html>
    after getting objectstart of program sun/jdbc/odbc/JdbcOdbcDriver java.lang.ClassNotFoundException: sun/jdbc/odbc/JdbcOdbcDriver sun/jdbc/odbc/JdbcOdbcDriver

    what would I set the classpath to be .. and I am sorry I am new to this.. but how would I be able to check the CLASSPATH .. or even how do I set the CLASSPATH.. to which directory would i need to set the classpath to
    I know I can set the classpath in dos by set CLASSPATH=
    but I dont know how to set it so it would read the drivers

  • Obejct not found error when accessing login.jsp

    Im trying to run a couple of samples I made using Web integration developer tool and following the walkthroughs.
    They did work for a while but after 3 weeks I try to test them again but I got this error message:
    Object not found.
    this the url I use to get the login page: http://localhost:5555.domainname/panama/server/papz/login.jsp
    Can anyone give me an idea what this can be??
    Im using Windows NT 4.0.

    Thanks for you reply Aparikh,
    you were right the url I was using wasn't correct but I still get the same error message.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Aparikh:
    The URL looks incorrect.
    Should be like http://localhost.domainname:5555/panama/server/papz/login.jsp .
    Regards.<HR></BLOCKQUOTE>
    null

  • Webutil - java bean not found issue when openning the form another time

    Hello,
    I have a form which uses webutil and is called from another form (using CALL_FORM), the code runs from the when-window-activated trigger and it works well.
    But after the form closes (EXIT_FORM), and then called again (CALL_FORM(...,HIDE) it shows a message that the file java bean was not found....
    can someone help?

    Hello,
    Maybe this comes from the HIDE parameter. Actually, the bean area have to be shown (so its visible property must be true and the canvas must be displayed) to be taken into account.
    Francois

  • Help! 'Page not found error' when use the word 'account' on my web page!

    I have encountered the weirdest problem when making some changes to my website.
    When adding text within the <p></p> tags  everything is fine until I type the word 'account' or 'accounts' then I get a 'page not found' error.
    Any other text can go between those tags, only the word 'account' causes the problem.
    Any ideas?
    (I am using Dreamweaver MX 2004 and its a PHP page)
    I am so confused on this one, so any help would be much appreciated!
    Thanks.

    http://www.reformationassociates.com/ - This is the website, the weirdest part is, it is only happening on pages after they have been opened through Dreamweaver, so it's only once I access them that the problem occurs, I dont have to make any changes, just open them and they suddenly show up as 'page not found'.  
    http://www.reformationassociates.com/archive/Pinnacle.php is one of the pages that was accessed yesterday via Dreamweaver and we have had to change the word to 'acct' to stop the 'page not found' error.
    Afriad I dont know what SSI files are? sorry....
    Thanks.

  • HTTP/1.1: 10.4.5 404 Not Found Error while accessing the odsm url

    Hi experts,
    I 've installed OID 11.1.1.6 on weblogic server 10.6.. on Oracle linux 6.0
    The Installation went fine And I am able to lauch the odsm default url http:\\localhost:7005/odsm  and  even chnaged the cn=orcladmin User password.
    Also created few user and Groups using odsm,
    However when i tried to access the odsm url after restarting the Admin & managed server . I am unable to access the  odsm url. for that i tired to deploy the odsm.ear on Admin server but it failed  getting the following error.
    in the Adminserver.log file
    2013 8:33:59 AM IST> <Error> <Console> <idm.oracle.com> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <> <1371956639366> <BEA-240003> <Console encountered the following error weblogic.management.DeploymentException: [J2EE:160149]Error while processing library references. Unresolved application library references, defined in weblogic-application.xml: [Extension-Name: adf.oracle.domain, exact-match: false].
            at weblogic.application.internal.flow.CheckLibraryReferenceFlow.prepare(CheckLibraryReferenceFlow.java:26)
            at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
            at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
            at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:59)
            at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
            at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
            at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
            at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
            at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperati
    <Warning> <Deployer> <idm.oracle.com> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1371956639265> <BEA-149004> <Failures were detected while initiating deploy task for application 'odsm [Version=11.1.1.2.0]'.>
    ####<Jun 23, 2013 8:33:59 AM IST> <Warning> <Deployer> <idm.oracle.com> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1371956639268> <BEA-149078> <Stack trace for message 149004
    And in wls_ods1.log file got the following error
    <BEA-149265> <Failure occurred in the execution of deployment request with ID '1371955199392' for task '0'. Error is: 'weblogic.management.DeploymentException: [J2EE:160149]Error while processing library references. Unresolved application library references, defined in weblogic-application.xml: [Extension-Name: adf.oracle.domain, exact-match: false].'
    weblogic.management.DeploymentException: [J2EE:160149]Error while processing library references. Unresolved application library references, defined in weblogic-application.xml: [Extension-Name: adf.oracle.domain, exact-match: false].
            at weblogic.application.internal.flow.CheckLibraryReferenceFlow.prepare(CheckLibraryReferenceFlow.java:26)
            at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
            at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
            at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
        Than i tired to deploy the odsm.ear on managed server i.e wls_ods1 and later on both but got the same error.
       Also  There is no issue with the oidsrv or oidladpd proccess as with the start/stop of oid*  related proccesses using opmnctl
       Please see the following.
    e@idm stage]$ oidctl connect=OIDDB status -diag
    oidctl : INSTANCE_NAME   is not set, defaulting to inst1
    oidctl : COMPONENT_NAME  is not set, defaulting to oid1
    NLS_LANG not set in environment
    Setting NLS_LANG to AMERICAN_AMERICA.AL32UTF8
      +--------------------------------------------------------------------------+
      | Process      |  PID   |   InstName    |  CompName   |Inst#| Port | Sport |
      +--------------------------------------------------------------------------+
      | oidmon       |  25968 |      asinst_1 |        oid3 |    0|      |       |
      +--------------------------------------------------------------------------+
      | oidldapd disp|  26010 |      asinst_1 |        oid3 |    1| 3060 |  3131 |
      | oidldapd serv|  26021 |      asinst_1 |        oid3 |    1| 3060 |  3131 |
      | Config   DN  | cn=oid3,cn=osdldapd,cn=subconfigsubentry                  |
      +--------------------------------------------------------------------------+
      +--------------------------------------------------------------------------+
      |Printing LDAP Operation in progress status ...                          |
      +--------------------------------------------------------------------------+
        OIDLDAPD_PID: 26021 WorkerID: 9 DBSID: 263 DBPID: 26075 ==> IDLE
      +--------------------------------------------------------------------------+
        OIDLDAPD_PID: 26021 WorkerID: 11 DBSID: 527 DBPID: 26078 ==> IDLE
      +--------------------------------------------------------------------------+
        OIDLDAPD_PID: 26021 WorkerID: 8 DBSID: 8 DBPID: 26080 ==> IDLE
      +--------------------------------------------------------------------------+
        OIDLDAPD_PID: 26021 WorkerID: 13 DBSID: 133 DBPID: 26108 ==> IDLE
      +--------------------------------------------------------------------------+
        OIDLDAPD_PID: 26021 WorkerID: 10 DBSID: 526 DBPID: 26056 ==> IDLE
      +--------------------------------------------------------------------------+
        OIDLDAPD_PID: 26021 WorkerID: 12 DBSID: 650 DBPID: 26058 ==> IDLE
      +--------------------------------------------------------------------------+
              Cache Max Size                     : 209716224
              Max Entries configured             : 100000
              Max Entries cached                 : 0
              Num Entries in Cache               : 0
              Num Entries in GC                  : 0
              Page size                          : 102392
              Entry cache Hit count              : 0
              Entry cache Mis count              : 0
              Hash Area bytes used               : 13031472
              Hash Area blocks used              : 138
              ResultSet cache bytes used         : 0
              Resultset cache blocks used        : 0
              Entry cache bytes used             : 0
    Cache memory used          
    : 13031472
    [oracle@idm stage]$ opmnctl status -l
    Processes in Instance: asinst_1
    ---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
    ias-component            
    | process-type
    |
    pid | status   |
    uid |  memused |
    uptime | ports
    ---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
    ohs1                     
    | OHS        
    |   25970 | Alive
    |
    1803561142 |  2127440 |  38:11:26 | https:9999,https:4443,http:7777
    oid3                     
    | oidldapd   
    |   26021 | Alive
    |
    1803561144 |  1425784 |  38:11:26 | N/A
    oid3                     
    | oidldapd   
    |   26010 | Alive
    |
    1803561143 |   435572 |  38:11:26 | N/A
    oid3                     
    | oidmon     
    |   25968 | Alive
    |
    1803561141 |   888088 |  38:11:26 | LDAPS:3131,LDAP:3060
    EMAGENT                  
    | EMAGENT    
    |   25967 | Alive
    |
    1803561140 |   106100 |  38:11:26 | N/A
    $ netstat -an |grep 3060
    tcp
    0
    0 :::3060             
    LISTEN
    [oracle@idm stage]$ ps -ef |grep 3060
    oracle
    7368  2130  0 05:53 pts/0
    00:00:00 grep 3060
    oracle   26021
    1  9 Jun24 ?
    03:33:54 oidldapd
    control=26010 connect=oiddb debug=0 configset=0 instance=1 key=26748
    host=idm.oracle.com logchange=TRUE port=3060 sport=3131
    [oracle@idm stage]$ tnsping OIDDB
    TNS Ping Utility for Linux: Version 11.1.0.7.0 - Production on 26-JUN-2013
    05:53:20
    Copyright (c) 1997, 2008, Oracle.  All rights reserved.
    Used parameter files:
    /idm/Middleware/Oracle_IDM2/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact
    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=idm.oracle.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=idmoid.oracle.com)))
    OK (0 msec)
      Also I am able to access oracle HTTP server web page i.e
    http://idm.oracle.com:7777/
    Could anyone suggest as why after restarting the server am not able to access the odsm url and getting error in deploying the odsm.ear file.
    Also after struggling with this error for 3 days i tried to Reinstall the oid after completely uninstalling it. But as soon as i restarted the  server  The odsm url become inaccessible
    and getting the same Old error.
       Also one Important things that i observed that before restarting the Admin & managed server when the odsm url was accessible when i do grep the port 3060 i.e
    root@idm config]# netstat -an |grep 3060
    tcp        0      0 :::3060                     :::*
    LISTEN
    tcp        0      0 ::ffff:192.168.122.13:3060  ::ffff:192.168.122.13:24645
    ESTABLISHED
    tcp        0      0 ::ffff:192.168.122.13:24645 ::ffff:192.168.122.13:3060
    ESTABLISHED
    tcp        0      0 ::ffff:192.168.122.13:3060  ::ffff:192.168.122.13:58065
    ESTABLISHED
    tcp        0      0 ::ffff:192.168.122.13:58065 ::ffff:192.168.122.13:3060
    ESTABLISHED
      After the restart of server i got this  output of 3060 port
    $ netstat -an |grep 3060
    tcp   

    0 :::3060                
    LISTEN
    I could not understand why this truncated output of 3060 port even though  all opmn manged proccess working fine as it's obvious from the out put from
    $ oidctl connect=OIDDB status -diag And $ opmnctl status -l commands output which i 've posted above.
    and am able start/stop oid related proccess from opmnct command
    Please Help.  as am really struggling to work around the issue.
    Thanks & Regards
    Priya

    If what that guys said about it being :7001/em doesn't work, When you configured your domain did you check the box that says Oracle Enterprise Manager. We had the same thing happen to us one time and it's because we didn't install it you have to check that box for it to be installed.

  • Most search engines are not working, only Google Search works and I get 404 file not found error when clicking the links.

    I have been trying virus killers, malware software from microsoft, I uninstalled Firefox and reinstalled it, I used the option to change all my options to the basic default installed options, I am able to search without problems using Internet Explorer on all search engines, Google Search engine works in firefox browser; but all the links give the 404 file not found error. Links from my Gmail account do not work either...giving me the 404 error. Firefox is much faster than Internet explorer however, this link problem makes me wonder if firefox is really any good.

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!

  • SOAP  oracle xml sql utility class definition not found error

    I have created a java class that connects to database using JDBC runs an sql statement and produces xml using Oracle XML SQL Utility class. The java class works perfectly when I deploy it as a soap web service and try to run through SOAP server it gives a SOAP error oracle/xml/sql/query/OracleXML/Query [java.lang.NoClassDefFoundError].
    Can anyone help please.
    Thanks
    Alina

    Sounds like you have not included the xsu12.jar file in the server-side CLASSPATH.
    This depends also on the xmlparserv2.jar and on the Oracle JDBC driver. Later versions
    of XSU may also depend on the xdb.jar file, too.

  • Class not found error when using javah

    Im just trying to create a simple hello world program using jni however I already got stuck trying to create the c header file when I run the javah program. It keeps telling that the class is not found but the class is in the local directory. Should a classpath be set or are there other things that I am missing?

    You should have a classpath pointing to the local directory.

  • Class not found exception when launching opencounterslogger.bat

    PORTAL_HOME=D:\bea\alui\ptportal\10.3.0
    Expected PORTAL_HOME=D:\bea\alui\ptportal\10.3.0
    claspath is D:\bea\alui\ptportal\10.3.0\lib\java\jakarta-oro-2.0.7.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openfoundation.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openlog-framework.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openconfig.jar;D:\bea\alui\ptportal\10.3.0\lib\java\openkernel.jar;D:\bea\alui\ptportal\1
    0.3.0\lib\java\pmb.jar;D:\bea\alui\ptportal\10.3.0\lib\java\opencounters.jar
    Exception in thread "Main Thread" java.lang.NoClassDefFoundError: com/plumtree/openkernel/impl/counters/adaptor/logger/PTRemoteCounterLoggerMain
    Press any key to continue . . .
    The class PTRemoteCounterLoggerMain is not in any of the jars in the classpath. Also opencountersconsole.bat is not to be seen is the installation

    Hi Mark,
    I have seen your two posts and there are something you need to notice:
    Where the ClassNotFound exception you got? From deployment tool or
    application server kjs process?
    Of course, you need not to add supporting classes to each ejb jars or ears.
    1. If you use deployment tool to package your application, I'm sure you'll
    fail to resovle your classes without supporting classes added to jars.
    Please select Edit->Preference,in Classpath entry, enter the supporting
    classes(packaged to jar files) location. This should work.
    2. After deploy to ias, please edit the registry using kregedit which you
    described in your posts.
    Regards,
    Johnson
    "Mark Priest" <[email protected]> wrote in message
    news:9s6h33$[email protected]..
    When I deploy EJBs to the iPlanet app server I find that I need to include
    all supporting classes in each ejb jar file. According to the
    Administrator's manual I should be able to modify the kjs classpath bydoing
    the following:
    On Windows
    a.. Open iPlanet Registry Editor.
    (See About iPlanet Registry Editor)
    b.. Open the following key:
    SOFTWARE\iPlanet\Application Server\6.0\Java\
    c.. Modify the class path and restart the server for the change to take
    effect.
    However, when I add my supporting classes to a jar in this directory Istill
    get a class not found exception when I run the deployment tool.
    Adding the classes to each EJB jar is redundant and introduces lots of
    problems. How should I configure iPlanet so I only need to put my
    supporting classes in one place?
    Thanks,
    Mark

  • When trying to access itunes, i get an error message that MSVCR90.dll was not found and to reinstall the program.

    when trying to access itunes, i get an error message that MSVCR90.dll was not found and to reinstall the program  If I uninstall and reinstall itunes, will I lose my library

    See Troubleshooting issues with iTunes for Windows updates.
    Your library should be fine, but you ought to back it up regularly.
    tt2

  • "Class Circle not found in TryBouncingBalls" error message. Help !

    Dear People,
    I have an error message :
    "TryBouncingBalls.java": Error : class Circle not found in class stan_bluej_ch5_p135.TryBouncingBalls at line 67, "
    Circle circle = new Circle(xPos + 130, 30);
    below are the classes TryBouncingBalls, BouncingBall, BallDemo, Canvas
    Thank you in advance
    Stan
    package stan_bluej_ch5_p135;
    import java.awt.*;
    import java.awt.geom.*;
    public class TryBouncingBalls
    public static void main(String[] args)
    Canvas myCanvas = new Canvas("Creativity at its best");
    myCanvas.setVisible(true);
    BouncingBall ball = new BouncingBall(50,50,16, Color.red, 500, myCanvas);
    BouncingBall ball2 = new BouncingBall(70,80,20, Color.green, 500, myCanvas);
    BouncingBall ball3 = new BouncingBall(90,100,16, Color.red, 500, myCanvas);
    BouncingBall ball4 = new BouncingBall(30,30,20, Color.green, 500, myCanvas);
    ball.draw();
    ball2.draw();
    ball.draw();
    ball2.draw();
    // make them bounce
    boolean finished = false;
    while(!finished) {
    myCanvas.wait(50); // small delay
    ball.move();
    ball2.move();
    ball3.move();
    ball4.move();
    // stop once ball has travelled a certain distance on x axis
    if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550)
    finished = true;
    myCanvas.setFont(new Font("helvetica", Font.BOLD, 14));
    myCanvas.setForegroundColor(Color.red);
    myCanvas.drawString("We are having fun, ...\n\n", 20, 30);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.black);
    myCanvas.drawString("...drawing lines...", 60, 60);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawLine(200, 20, 300, 50);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.blue);
    myCanvas.drawLine(220, 100, 370, 40);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.green);
    myCanvas.drawLine(290, 10, 320, 120);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawString("...and shapes!", 110, 90);
    myCanvas.setForegroundColor(Color.red);
    myCanvas.drawString("to bring to focus creative ideas !", 310, 290);
    // the shape to draw and move
    int xPos = 10;
    Rectangle rect = new Rectangle(xPos + 40, 150, 30, 20);
    Rectangle rect2 = new Rectangle(xPos + 80, 120, 50, 25);
    Rectangle rect3 = new Rectangle(xPos+ 1200, 180, 30, 30);
    Rectangle rect4 = new Rectangle(xPos + 150, 220, 40, 15);
    myCanvas.fill(rect);
    myCanvas.fill(rect2);
    myCanvas.fill(rect3);
    myCanvas.fill(rect4);
    Circle circle = new Circle(xPos + 130, 30);
    // Circle circle2 = new Circle(xPos + 150, 50);
    // Circle circle3 = new Circle(xPos + 170, 30);
    // Circle circle4 = new Circle(xPos + 200, 40);
    // myCanvas.fill(circle);
    // myCanvas.fill(circle2);
    // myCanvas.fill(circle3);
    // myCanvas.fill(circle4);
    // move the rectangle and circles across the screen
    for(int i = 0; i < 200; i ++) {
    myCanvas.fill(rect);
    myCanvas.fill(rect2);
    myCanvas.fill(rect3);
    myCanvas.fill(rect4);
    myCanvas.wait(10);
    myCanvas.erase(rect);
    myCanvas.erase(rect2);
    myCanvas.erase(rect3);
    myCanvas.erase(rect4);
    xPos++;
    rect.setLocation(xPos, 150);
    rect2.setLocation(xPos, 120);
    rect3.setLocation(xPos, 180);
    rect4.setLocation(xPos, 220);
    // at the end of the move, draw once more so that it remains visible
    myCanvas.fill(rect);
    myCanvas.fill(rect2);
    myCanvas.fill(rect3);
    myCanvas.fill(rect4);
    package stan_bluej_ch5_p135;
    import java.awt.*;
    import java.awt.geom.*;
    * Class BouncingBall - a graphical ball that observes the effect of gravity. The ball
    * has the ability to move. Details of movement are determined by the ball itself. It
    * will fall downwards, accelerating with time due to the effect of gravity, and bounce
    * upward again when hitting the ground.
    * This movement can be initiated by repeated calls to the "move" method.
    * @author Bruce Quig
    * @author Michael Kolling (mik)
    * @author David J. Barnes
    * @version 1.1 (23-Jan-2002)
    public class BouncingBall
    private static final int gravity = 3; // effect of gravity
    private int ballDegradation = 2;
    private Ellipse2D.Double circle;
    private Color color;
    private int diameter;
    private int xPosition;
    private int yPosition;
    private final int groundPosition; // y position of ground
    private Canvas canvas;
    private int ySpeed = 1; // initial downward speed
    * Constructor for objects of class BouncingBall
    * @param xPos the horizontal coordinate of the ball
    * @param yPos the vertical coordinate of the ball
    * @param ballDiameter the diameter (in pixels) of the ball
    * @param ballColor the color of the ball
    * @param groundPos the position of the ground (where the wall will bounce)
    * @param drawingCanvas the canvas to draw this ball on
    public BouncingBall(int xPos, int yPos, int ballDiameter, Color ballColor,
    int groundPos, Canvas drawingCanvas)
    xPosition = xPos;
    yPosition = yPos;
    color = ballColor;
    diameter = ballDiameter;
    groundPosition = groundPos;
    canvas = drawingCanvas;
    * Draw this ball at its current position onto the canvas.
    public void draw()
    canvas.setForegroundColor(color);
    canvas.fillCircle(xPosition, yPosition, diameter);
    * Erase this ball at its current position.
    public void erase()
    canvas.eraseCircle(xPosition, yPosition, diameter);
    * Move this ball according to its position and speed and redraw.
    public void move()
    // remove from canvas at the current position
    erase();
    // compute new position
    ySpeed += gravity;
    yPosition += ySpeed;
    xPosition +=2;
    // check if it has hit the ground
    if(yPosition >= (groundPosition - diameter) && ySpeed > 0) {
    yPosition = (int)(groundPosition - diameter);
    ySpeed = -ySpeed + ballDegradation;
    // draw again at new position
    draw();
    * return the horizontal position of this ball
    public int getXPosition()
    return xPosition;
    * return the vertical position of this ball
    public int getYPosition()
    return yPosition;
    package stan_bluej_ch5_p135;
    import java.awt.*;
    import java.awt.geom.*;
    * Class BallDemo - provides two short demonstrations showing how to use the
    * Canvas class.
    * @author Michael Kolling and David J. Barnes
    * @version 1.0 (23-Jan-2002)
    public class BallDemo
    private Canvas myCanvas;
    * Create a BallDemo object. Creates a fresh canvas and makes it visible.
    public BallDemo()
    myCanvas = new Canvas("Ball Demo", 600, 500);
    myCanvas.setVisible(true);
    * This method demonstrates some of the drawing operations that are
    * available on a Canvas object.
    public void drawDemo()
    myCanvas.setFont(new Font("helvetica", Font.BOLD, 14));
    myCanvas.setForegroundColor(Color.red);
    myCanvas.drawString("We can draw text, ...", 20, 30);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.black);
    myCanvas.drawString("...draw lines...", 60, 60);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawLine(200, 20, 300, 50);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.blue);
    myCanvas.drawLine(220, 100, 370, 40);
    myCanvas.wait(500);
    myCanvas.setForegroundColor(Color.green);
    myCanvas.drawLine(290, 10, 320, 120);
    myCanvas.wait(1000);
    myCanvas.setForegroundColor(Color.gray);
    myCanvas.drawString("...and shapes!", 110, 90);
    myCanvas.setForegroundColor(Color.red);
    // the shape to draw and move
    int xPos = 10;
    Rectangle rect = new Rectangle(xPos, 150, 30, 20);
    // move the rectangle across the screen
    for(int i = 0; i < 200; i ++) {
    myCanvas.fill(rect);
    myCanvas.wait(10);
    myCanvas.erase(rect);
    xPos++;
    rect.setLocation(xPos, 150);
    // at the end of the move, draw once more so that it remains visible
    myCanvas.fill(rect);
    * Simulates two bouncing balls
    public void bounce()
    int ground = 400; // position of the ground line
    myCanvas.setVisible(true);
    // draw the ground
    myCanvas.drawLine(50, ground, 550, ground);
    // crate and show the balls
    BouncingBall ball = new BouncingBall(50, 50, 16, Color.blue, ground, myCanvas);
    ball.draw();
    BouncingBall ball2 = new BouncingBall(70, 80, 20, Color.red, ground, myCanvas);
    ball2.draw();
    // make them bounce
    boolean finished = false;
    while(!finished) {
    myCanvas.wait(50); // small delay
    ball.move();
    ball2.move();
    // stop once ball has travelled a certain distance on x axis
    if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550)
    finished = true;
    ball.erase();
    ball2.erase();
    package stan_bluej_ch5_p135;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.*;
    * Class Canvas - a class to allow for simple graphical
    * drawing on a canvas.
    * @author Michael Kolling (mik)
    * @author Bruce Quig
    * @version 1.8 (23.01.2002)
    public class Canvas
    private JFrame frame;
    private CanvasPane canvas;
    private Graphics2D graphic;
    private Color backgroundColor;
    private Image canvasImage;
    * Create a Canvas with default height, width and background color
    * (300, 300, white).
    * @param title title to appear in Canvas Frame
    public Canvas(String title)
    this(title, 600, 600, Color.white);
    * Create a Canvas with default background color (white).
    * @param title title to appear in Canvas Frame
    * @param width the desired width for the canvas
    * @param height the desired height for the canvas
    public Canvas(String title, int width, int height)
    this(title, width, height, Color.white);
    * Create a Canvas.
    * @param title title to appear in Canvas Frame
    * @param width the desired width for the canvas
    * @param height the desired height for the canvas
    * @param bgClour the desired background color of the canvas
    public Canvas(String title, int width, int height, Color bgColor)
    frame = new JFrame();
    canvas = new CanvasPane();
    frame.setContentPane(canvas);
    frame.setTitle(title);
    canvas.setPreferredSize(new Dimension(width, height));
    backgroundColor = bgColor;
    frame.pack();
    * Set the canvas visibility and brings canvas to the front of screen
    * when made visible. This method can also be used to bring an already
    * visible canvas to the front of other windows.
    * @param visible boolean value representing the desired visibility of
    * the canvas (true or false)
    public void setVisible(boolean visible)
    if(graphic == null) {
    // first time: instantiate the offscreen image and fill it with
    // the background color
    Dimension size = canvas.getSize();
    canvasImage = canvas.createImage(size.width, size.height);
    graphic = (Graphics2D)canvasImage.getGraphics();
    graphic.setColor(backgroundColor);
    graphic.fillRect(0, 0, size.width, size.height);
    graphic.setColor(Color.black);
    frame.show();
    * Provide information on visibility of the Canvas.
    * @return true if canvas is visible, false otherwise
    public boolean isVisible()
    return frame.isVisible();
    * Draw the outline of a given shape onto the canvas.
    * @param shape the shape object to be drawn on the canvas
    public void draw(Shape shape)
    graphic.draw(shape);
    canvas.repaint();
    * Fill the internal dimensions of a given shape with the current
    * foreground color of the canvas.
    * @param shape the shape object to be filled
    public void fill(Shape shape)
    graphic.fill(shape);
    canvas.repaint();
    * Fill the internal dimensions of the given circle with the current
    * foreground color of the canvas.
    public void fillCircle(int xPos, int yPos, int diameter)
    Ellipse2D.Double circle = new Ellipse2D.Double(xPos, yPos, diameter, diameter);
    fill(circle);
    * Fill the internal dimensions of the given rectangle with the current
    * foreground color of the canvas. This is a convenience method. A similar
    * effect can be achieved with the "fill" method.
    public void fillRectangle(int xPos, int yPos, int width, int height)
    fill(new Rectangle(xPos, yPos, width, height));
    * Erase the whole canvas.
    public void erase()
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    Dimension size = canvas.getSize();
    graphic.fill(new Rectangle(0, 0, size.width, size.height));
    graphic.setColor(original);
    canvas.repaint();
    * Erase the internal dimensions of the given circle. This is a
    * convenience method. A similar effect can be achieved with
    * the "erase" method.
    public void eraseCircle(int xPos, int yPos, int diameter)
    Ellipse2D.Double circle = new Ellipse2D.Double(xPos, yPos, diameter, diameter);
    erase(circle);
    * Erase the internal dimensions of the given rectangle. This is a
    * convenience method. A similar effect can be achieved with
    * the "erase" method.
    public void eraseRectangle(int xPos, int yPos, int width, int height)
    erase(new Rectangle(xPos, yPos, width, height));
    * Erase a given shape's interior on the screen.
    * @param shape the shape object to be erased
    public void erase(Shape shape)
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    graphic.fill(shape); // erase by filling background color
    graphic.setColor(original);
    canvas.repaint();
    * Erases a given shape's outline on the screen.
    * @param shape the shape object to be erased
    public void eraseOutline(Shape shape)
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    graphic.draw(shape); // erase by drawing background color
    graphic.setColor(original);
    canvas.repaint();
    * Draws an image onto the canvas.
    * @param image the Image object to be displayed
    * @param x x co-ordinate for Image placement
    * @param y y co-ordinate for Image placement
    * @return returns boolean value representing whether the image was
    * completely loaded
    public boolean drawImage(Image image, int x, int y)
    boolean result = graphic.drawImage(image, x, y, null);
    canvas.repaint();
    return result;
    * Draws a String on the Canvas.
    * @param text the String to be displayed
    * @param x x co-ordinate for text placement
    * @param y y co-ordinate for text placement
    public void drawString(String text, int x, int y)
    graphic.drawString(text, x, y);
    canvas.repaint();
    * Erases a String on the Canvas.
    * @param text the String to be displayed
    * @param x x co-ordinate for text placement
    * @param y y co-ordinate for text placement
    public void eraseString(String text, int x, int y)
    Color original = graphic.getColor();
    graphic.setColor(backgroundColor);
    graphic.drawString(text, x, y);
    graphic.setColor(original);
    canvas.repaint();
    * Draws a line on the Canvas.
    * @param x1 x co-ordinate of start of line
    * @param y1 y co-ordinate of start of line
    * @param x2 x co-ordinate of end of line
    * @param y2 y co-ordinate of end of line
    public void drawLine(int x1, int y1, int x2, int y2)
    graphic.drawLine(x1, y1, x2, y2);
    canvas.repaint();
    * Sets the foreground color of the Canvas.
    * @param newColor the new color for the foreground of the Canvas
    public void setForegroundColor(Color blue)
    graphic.setColor(Color.blue);
    * Returns the current color of the foreground.
    * @return the color of the foreground of the Canvas
    public Color getForegroundColor()
    return graphic.getColor();
    * Sets the background color of the Canvas.
    * @param newColor the new color for the background of the Canvas
    public void setBackgroundColor(Color newColor)
    backgroundColor = newColor;
    graphic.setBackground(newColor);
    * Returns the current color of the background
    * @return the color of the background of the Canvas
    public Color getBackgroundColor()
    return backgroundColor;
    * changes the current Font used on the Canvas
    * @param newFont new font to be used for String output
    public void setFont(Font newFont)
    graphic.setFont(newFont);
    * Returns the current font of the canvas.
    * @return the font currently in use
    public Font getFont()
    return graphic.getFont();
    * Sets the size of the canvas.
    * @param width new width
    * @param height new height
    public void setSize(int width, int height)
    canvas.setPreferredSize(new Dimension(width, height));
    Image oldImage = canvasImage;
    canvasImage = canvas.createImage(width, height);
    graphic = (Graphics2D)canvasImage.getGraphics();
    graphic.drawImage(oldImage, 0, 0, null);
    frame.pack();
    * Returns the size of the canvas.
    * @return The current dimension of the canvas
    public Dimension getSize()
    return canvas.getSize();
    * Waits for a specified number of milliseconds before finishing.
    * This provides an easy way to specify a small delay which can be
    * used when producing animations.
    * @param milliseconds the number
    public void wait(int milliseconds)
    try
    Thread.sleep(milliseconds);
    catch (InterruptedException e)
    // ignoring exception at the moment
    * Nested class CanvasPane - the actual canvas component contained in the
    * Canvas frame. This is essentially a JPanel with added capability to
    * refresh the image drawn on it.
    private class CanvasPane extends JPanel
    public void paint(Graphics g)
    g.drawImage(canvasImage, 0, 0, null);

    Dear Miciuli,
    I found the definition for the circle in the canvas class and used it to creates circles ! Thank you for jaring my brain into thinking !
    Stan
    Ellipse2D.Double circle = new Ellipse2D.Double(xPos, 70, 30 , 30);

  • Error in File name or class name not found during Automation operation: 'CreateObj​ect'

    Hello Team,
    When I am trying to execute the below code i am getting the following error. Any help would be greatly appreciated.
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If Not oFSO.FolderExists(SavePath) Then
    Set f = oFSO.CreateFolder(SavePath)
    Else
    End If
    53 4/11/2014 12:27:22 PM Error:
    Error in <NoName(4).VBS> (Line: 9, Column: 1):
    File name or class name not found during Automation operation: 'CreateObject'
    I have googled through the error and tried to re-register the scrrun.dll using regsvr32 eventhogh it is successfully registered, i am getting the following error. My PC is windows 7 32bit OS.
    any help is greatly appreciated.

    The following script class will write a log file entry. See if it will run for you.
    The script is using a class object that you might not have seen before. A little intro:  The top section is just for testing the class. Normally I just comment this out after the class is working well.  It should run right way. I would save the vbs file in the editor, That way when you are using autoactpath or currentscriptpath variables they will be able resolve the paths.
    Paul
    Attachments:
    LoggingCode_V2.VBS ‏5 KB

Maybe you are looking for

  • Trouble Printing Start Times in Weekly View

    I'm unable to print the start times for some appointment. I noticed that they all have a duration of 1 hour or less so I suppose that it could be because of the lack of space. Does anyone know if there's any way change the font size or another work a

  • Storage Condition - how to make a default value in creating a material for

    When creating a material, where can I make shure that a default storage condition (MARA-RAUBE) is filled in for a specific material type?

  • CS5 64 bit Masking is not working

    Wierd problem in 64 bit layer masking dosen't work properly.  White reveals the layer below when using brush tool.  Black will not paint back in.  Isn't white working backwards?  I am using Win 7 core I7 processor with 12gig of ram. CS5 in 32 bit wor

  • Using table alias in a dataset

    We are using Crystal Reports 2008 and have created a report with the designer, that uses the same table twice - lets say that the table name is TBLPerson. Crystal then shows the second version af the table with an 1 - that is TBLPerson1. From a .NET

  • The system requires Service Pack 1 or higher

    I get this "requires Service Pack 1" message while trying to install Oracle9i Database 9.2.0.1 on XP Professional Service Pack 2. My guess is that it thinks I'm running W2K. I have seen similar posts here and elsewhere, but have yet to find the solut