J2EE Tutorial sample codes question

Hi there,
I just started to catchup some tutorials' sample codes using J2EE tutorial, what happened when i tried to compile the first example called "Converter" EJB, using the command:
ant converteri get all the files compiled except the ConverterClient.java which leads to some errors:
ConverterClient.java:15: '.' expected
import Converter;
^
ConverterClient.java:16: '.' expected
import ConverterHome;
^
ConverterClient.java:26: cannot resolve symbol
symbol : class ConverterHome
location: class ConverterClient
ConverterHome home =
^
ConverterClient.java:27: cannot resolve symbol
symbol : class ConverterHome
location: class ConverterClient
(ConverterHome)PortableRemoteObject.narrow(objref,
^
ConverterClient.java:28: cannot resolve symbol
symbol : class ConverterHome
location: class ConverterClient
ConverterHome.class);
^
ConverterClient.java:30: cannot resolve symbol
symbol : class Converter
location: class ConverterClient
Converter currencyConverter = home.create();
^
6 errors
whats wrong actually? I also tried to put the ConverterClient.java into another directory, after compiled the rest, then i copied the file into the build folder and compile it manually, yet still getting this error. Please help!
Thanks
Neo

I think you didn't read my question properly, i had said that i manually copied the ConverterClient to the other class together as it needs;
This is the code for ConverterClient:
* Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
* This software is the proprietary information of Sun Microsystems, Inc. 
* Use is subject to license terms.
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.math.BigDecimal;
import Converter;
import ConverterHome;
public class ConverterClient {
   public static void main(String[] args) {
       try {
           Context initial = new InitialContext();
           Context myEnv = (Context)initial.lookup("java:comp/env");
           Object objref = myEnv.lookup("ejb/SimpleConverter");
           ConverterHome home =
               (ConverterHome)PortableRemoteObject.narrow(objref,
                                            ConverterHome.class);
           Converter currencyConverter = home.create();
           BigDecimal param = new BigDecimal ("100.00");
           BigDecimal amount = currencyConverter.dollarToYen(param);
           System.out.println(amount);
           amount = currencyConverter.yenToEuro(param);
           System.out.println(amount);
           System.exit(0);
       } catch (Exception ex) {
           System.err.println("Caught an unexpected exception!");
           ex.printStackTrace();
} also please try the tutorial before answering...TQ :D

Similar Messages

  • Report Engine SDK sample code questions

    Hello,
    I've been able to view a boxi report in an iframe via the Enterprise SDK by modifying the sample code in the HowToViewWebiReports_VB example.
    I'm not totally happy with the way that's working, so I'm looking at using the Report Engine SDK, although I understand it's performance and scalability isn't quite as good as the Enterprise SDK.
    I'm a VB.NET guy, not a C# guy, and I'm not clear on how the wssdk_net2.0_portal_sample_12.0_en example is supposed to work.
    I don't have one and my CMS server is running Tomcat, not IIS so there's not going to be an ASP.NET web service running there.
    In the dsws.config for the wssdk_net2.0_portal_sample_12.0_en example I put the name of the CMS server, but it's looking for a web service at http://cmsservername:8080/dswsbobje/services/Session, but I get a 404 when i try to hit that. 
    I'm not familiar with Tomcat, but in searching around on the server, I see a dswsbobje directory under the webapps in my Tomcat installation, but I don't see a services or a Session folder underneath that.  In the dswsbobje folder I see the following folders:
    BOAR-INF
    META-INF
    WEB-INF
    xsd
    Is there something else that needs to be installed on the Tomcat server to get the web service running?
    -Eric

    It looks like I have something there.  When I launch launch http://servername:8080/dswsbobje,  I see:
    Apache-AXIS
    Hello! Welcome to Apache-Axis.
    What do you want to do today?
    Validate the local installation's configuration
    see below if this does not work.
    To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it.
    Validating Axis
    If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers.
    I clicked on the "Validate" link and I see:
    Axis Happiness Page
    Examining webapp configuration
    QaaWS Configuration
    QaaWS Servlet is not valid.
    ErrorServer servername not found or server may be down
    See Web Application log to get more info or read QaaWS v2 documentation starting with section
    Perhaps this environment needs some additional configuration?

  • Copy Webdynpro Tutorial Sample Code

    Hi Experts,
    There are plenty of tutorials and sample codes available on SDN. Can anybody please specify how to import these applications. It always gives me a classpath error when I try. The steps I use are
    1. Create a new Webdynpro Application.
    2. Import - Filesystem and select the folder that contains the code.
    Please do guide as to where I am going wrong.
    Regards
    Abdullah

    Hi ,
    The classpath errors are because they refer to some jars which are in a different path.
    Right click on the imported webdynpro project - > Properties - > Project Build Path ..
    Remove those jar assignments with errors (warning icon on them) and add those jars from your local system.
    Regards
    Bharathwaj

  • Services tutorial sample code

    hi all,
    can someone point me to a book/web tutorial that details how to go about creating standalone components that provide the Service menu functionality in finder.
    trawling through the various docs at apple don't seem to give a full picture of whats needed.
    <moan>
    it would be nice if there was an xcode template the could produce some boiler plate code.
    </moan>
    many thanks
    bg

    Have you looked at 10.6 yet?
    From Apple:
    "New Automator templates.
    It’s easier to create workflows using Automator with new starting points for Applications, Services, Folder Actions, iCal alarms, and more."
    'starting points' seems exactly what you're after. You might want to at least take a look before you write it off...good luck w/your efforts in any case.

  • Web Server 7.0 Tech preview will not run J2EE tutorial samples

    The j2ee 1.5 (javaee5) stuff is servlet 2.5. Since this looks like tomcat 5 under the hood, no surprises, but it would be nice if this were more clearly documented. (No JSF 1.2 for me!) This is understandable, I guess.
    The j2ee1.4 stuff, however, is irritating.
    first, refuses to precompile bookstore2: says circular reference in errorpage.jsf because prelude.jspf says that errorpage.jsp is the error page (actually circular reference error went away when I removed the error page decl from prelude.jspf)
    worse still, java.lang.StackOverflowError when using fmt.message! I reduced the bookstore2 bookstore.jsp to this:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <html>
    <head><title>Localized Dates</title></head>
    <body>
    <%
    try {
       Class c = org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class;
    %>
    <p><b><fmt:message key="What"/></b></p>
    <%
    } catch (Throwable t) {
       t.printStackTrace(System.err);
       throw t;
    %>
    </body>
    </html>---------
    Defining the variable c was just to make sure I was seeing what I thought: web server 7.0 can't load this class which I found in ${WS_INSTALL_ROOT}/lib/webserv-jstl.jar. Used printStackTrace cause log file was truncating.
    Here's what I got:
    java.lang.StackOverflowError
       ...next 12 lines repeated 3 more time
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
          at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
          at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1402)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1235)
          at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:145)
          at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:83)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at org.apache.jsp.index_jsp._jspService(index_jsp.java:55)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:345)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:311)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
          at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:391)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:272)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
          at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:232)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:160)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
          at com.sun.webserver.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:149)
          at com.sun.webserver.connector.nsapi.NSAPIConnector.service(NSAPIConnector.java:995)---------
    I also tried adding -Xss128m to the JVM parameters just to see if this was actually finite since the trace seem so short to me. (maybe the JVM ignored 128m cause it's too big?)
    Any ideas? Thanks!

    We have occasionally seen the problem that you describe with a 64-bit Web Server when loading deeply nested java classes due to the recursive class loading nature of the JDK classloader. Are you using a 64-bit or a 32 bit server?
    I cut and pasted the jsp in your message and accessed the jsp from the docroot and did not see the overflow. I was using the default configuration and I tried both 32-bit and 64-bit servers on Sparc/Solaris.
    However, the overflow can be fixed by increasing the native stack size using the admin CLI wadm command. The command changes that native stack size from the default of 128K to 136K.
    %install_dir/bin/wadm set-thread-pool-prop user=admin config=config_name --password-file=password-file stack-size=139264
    Also, the FCS release is now available at (http://www.sun.com/download/products.xml?id=45ad781d ).

  • Core MIDI sample code or tutorial

    Anyone know of a good sample project or tutorial for Core MIDI? Or, indeed any sample code or tutorial at all. The documentation isn't exactly helpful; I've tried to do the most basic thing I can think of which is to get the number of devices connected to the system using MIDIGetNumberOfExternalDevices(). It always returns 0. I've got two lines of code in an NSButton action:
    UInt32 hello = MIDIGetNumberOfExternalDevices();
    NSLog(\[NSString stringWithFormat:@"Num devices: %1i", hello\]);
    using ObjC obviously. I've tried this with MIDIGetNumberOfDevices() as well, with the same result. There are, obviously, MIDI devices connected to the system.
    What am I doing wrong? Can anyone help?

    Hi Morgan
    There is a Core Audio mailing list where Core Audio/Midi specialists hang out.
    Go to here: http://lists.apple.com/mailman/listinfo
    then choose this list: Coreaudio-api
    I'm sure that if you repost your question there you will get the answer.
    Bob

  • How to create a database for sample code from Tutorial/Book?

    I want to try out the sample code from [http://shop.oreilly.com/product/0636920013471.do] for the book SQL Pocket Guide 3rd Ed.
    I have downloaded the oracle vm/appliance for oracle 11g2 and I have started sqlplus as sysdba.
    I'm feeling overwhelmed with these links describing how to create a database:
    [http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html]
    [http://tldp.org/HOWTO/Oracle-7-HOWTO-3.html]
    [http://www.adp-gmbh.ch/ora/admin/creatingdbmanually.html]
    (1) What is the command to list the existing databases?
    (2) What is the command to delete an existing database?
    (3) When creating a new database with the create database command, is it necessary to specify the logfile, character set, national character set, datafile, sysaux datafile, undo tablespace, temp table space? Do these have reasonable defaults? I'm not sure what proper directories are to specify for Linux and the examples are for windows.
    Can someone give me a simplified create database command to create a database called 3rdEdPocketGuide? Should I follow the example at [http://tldp.org/HOWTO/Oracle-7-HOWTO-3.html] and instead of orcl use 3rdEdPocketGuide?
    (4) What command do I use to execute the script that comes with the book SQL Pocket Guide 3rd Ed? This is the script that has all the drop table, create table and insert commands in it.
    (5) What command do I use in sqlplus to set the current default database prior to running this script? Perhaps this is the connect command? I don't want my script to create tables in the system database.
    (6) I tried the command "connect 3rdEdPocketGuide" and it prompted for a password! Yikes! What password? Do I need to specify a password when I create a database? I cannot tell if I have successfully created such a database or it is just prompting me for a password to thwart malicious users. Is it is possible to create databases which don't require a password or maybe a zero length password?
    Thanks
    Siegfried
    Edited by: user8816970 on Sep 26, 2012 12:01 PM
    Edited by: user8816970 on Sep 26, 2012 12:18 PM

    user8816970 wrote:
    Paul,
    Thanks! I tried changing my profile name to siegfried but I'm not seeing the change...
    Anyway, I'm trying your suggestion to use SQL Developer which was already installed in the virtual box appliance and I cannot figure out how to get a connection.
    When I use the defaults of sid=xe, port=1521, hostname=localhost and specify
    username=sysdba
    password=
    I get status: failure - test failed: listener refursed connection with the following error: ORA 12505, TNS: listener does not current know of sid given.
    So I try sid=orcl and that works better: status: failure - test failed: ORA-01017: invalid username/passowrd; login denied
    OK, sqlplus let me in with out a password, why does not this work?
    So I try checking the box for "OS Authentication" and I get the same error!
    Hoek: I tried searching the documentation and found "3 Exploring Oracle Database with SQL Developer" at http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm but following those directions did not help. Can you be more specific? The directions were for a tutorial and I need to know what the passwords are for the database set up with [http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html|http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html] . I also found [http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG|http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG] but that did not help either.
    Everyone:
    Do I need to create a user using SQL*Plus first so I can login with "Oracle SQL Developer" so I create my database called? What would be the "create user" command I would execute?
    OK, so I run sqlplus and issue these commands
    create user siegfried identified by abc ;
    grant connect to siegfried ;
    connect siegfried/abc;
    Now, how do I create a database? In Microsoft SQL Server one has to create a database first and if you just start creating tables without creating a database first, the tables will be created in the system database and this is usually undesirable.
    Sometimes a database is known in the java connection string as the catalog. Is there any such analog in oracle SQL plus?
    So now what do I do? I want to create a bunch of tables using my script I downloaded from 3rd Ed SQL Pocket Guide. Does my new user "siegfried" have the right to create tables? I guess I could try but I don't want to create tables in the system database.
    I noticed I can also use "Oracle SQL Developer" to connect with my new "siegfried" account. It seems that I should have been able to connect with sysdba... strange.
    So now I am connected in the "Oracle SQL Developer" and I see no list of databases.
    Thanks!
    Siegfried
    >Paul,
    Thanks! I tried changing my profile name to siegfried but I'm not seeing the change...
    Anyway, I'm trying your suggestion to use SQL Developer which was already installed in the virtual box appliance and I cannot figure out how to get a connection.
    When I use the defaults of sid=xe, port=1521, hostname=localhost and specify
    username=sysdba
    password=
    I get status: failure - test failed: listener refursed connection with the following error: ORA 12505, TNS: listener does not current know of sid given.
    So I try sid=orcl and that works better: status: failure - test failed: ORA-01017: invalid username/passowrd; login denied
    OK, sqlplus let me in with out a password, why does not this work?
    So I try checking the box for "OS Authentication" and I get the same error!
    Hoek: I tried searching the documentation and found "3 Exploring Oracle Database with SQL Developer" at http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm but following those directions did not help. Can you be more specific? The directions were for a tutorial and I need to know what the passwords are for the database set up with [http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html|http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html] . I also found [http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG|http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/tdddg_connecting.htm#CEGHFHIG] but that did not help either.
    Everyone:
    Do I need to create a user using SQL*Plus first so I can login with "Oracle SQL Developer" so I create my database called? What would be the "create user" command I would execute?
    OK, so I run sqlplus and issue these commands
    create user siegfried identified by abc ;
    grant connect to siegfried ;
    connect siegfried/abc;
    above does NOT use SQL*Net to connect to the instance
    >
    Now, how do I create a database? In Microsoft SQL Server one has to create a database first and if you just start creating tables without creating a database first, the tables will be created in the system database and this is usually undesirable.
    Sometimes a database is known in the java connection string as the catalog. Is there any such analog in oracle SQL plus?
    So now what do I do? I want to create a bunch of tables using my script I downloaded from 3rd Ed SQL Pocket Guide. Does my new user "siegfried" have the right to create tables? I guess I could try but I don't want to create tables in the system database.
    I noticed I can also use "Oracle SQL Developer" to connect with my new "siegfried" account. It seems that I should have been able to connect with sysdba... strange.
    So now I am connected in the "Oracle SQL Developer" and I see no list of databases.SQL Developer can only connect to the instance via SQL*Net
    >
    Thanks!
    Siegfrieda database in SQL Server is same as schema/user in Oracle

  • Sun ejb tutorial compilation problem with sample code

    I have been trying to follow the ejb tutorial off of Sun's web site. However, I get the following problem when I try to compile the sample code.
    prompt>javac Demo.java
    works fine
    Prompt>javac DemoBean.java
    works fine
    Prompt>javac DemoHome.java
    DemoHome.java:23: cannot resolve symbol
    symbol : class Demo
    location: interface ejb.demo.DemoHome
    public Demo create() throws CreateException, RemoteException;
    ^
    1 error
    Prompt>
    Can anyone help me out as I have tried several books which conveniently skip the part about compiling errors.
    I noticed I don't have a CLASSPATH variable and then i created one with just '.' in it and that didn't work. any help would be appreciated as this is driving me crazy. Thanks.

    try to change the order of the exception.
    first RemoteException and then CreateException

  • Look for JDeveloper Tutorial with samples code

    Hello All ,
    my name is Ron ,
    i'm new user of JDeveloper i'm looking for a place to start a tutorial "How to use
    the JDeveloper ? " with samples code .
    from very basic use ( Hello world program ) to addvanced programming ( Like GUI Forms and Database )
    please show me links where to start learning from
    thanks in advance

    The tutorials in the JDeveloper help system are a very good place to start. Choose Help | Help Topics from the JDeveloper menu then click the Tutorials book in the Help navigator. The tutorials are also available on OTN, see:
    http://otn.oracle.com:8877/jdeveloper/help/
    You may also find the 'how to' documents and samples on OTN helpful:
    Oracle9i JDeveloper How To Documents
    http://otn.oracle.com/products/jdev/howtos/content.html
    Oracle9i JDeveloper Sample Code
    http://otn.oracle.com/sample_code/products/jdev/content.html
    Hope this helps.
    - jon

  • JTAPI tutorial and code samples??

    Hello guys!
    Please somebody could tell-me where can I download a tutorial and code samples to start my studies on Java Telephony?
    Or may could somebory send to me for [email protected] .
    Thanks a lot. God bless you all !
    bye bye.

    http://www.zurich.ibm.com/csc/distribsys/j323/jtapi-tutorial.pdf
    The above contains a simple tutorial. Also looking for tutorials if you get any let me
    know. email to nchirara at Gmail dot com.
    later
    you are what you think you are if you think you are what you are ?!

  • Tutorial or code sample in creating a .exe for windows

    Hi all,
    Can some kind soul guide me to a tutorial / materials / code sample in creating a .exe (for a java program) to run in windows ?
    My intention is to create a .exe such that when it is clicked, the java program runs.
    thanks a bundle.

    Java in not intended to compile into system executables. IMO, you should not do this, let your application remain cross-platform. You can simply make an executable JAR file, which makes your application run with a double-click on any system which have a JRE installed.
    Anyway, if you really want to help M$ solidify their work, search the forum. It has been asked and answered several times. You have two options:
    1. Bundle a version of JRE with your application, and create an executable file which runs your application on the bundled JRE.
    2. Use a native code compiler like ( http://www.excelsior-usa.com/jet.html ).
    Also, try these:
    http://www.dobysoft.com/products/nativej/
    http://www.ej-technologies.com/products/exe4j/overview.html

  • Looking for sample code to create my own pub/sub!

    I am a new bee in JMS. So I would really appreciate if
    some one could give me some hint to start up with my school project. I am looking for a sample Java code that will:
    For the Publisher:
    1. Connect to a broker [create it, if it does not exist]
    2. Create a publisher/destination.
    3. Create a pub-sub queue
    4. Publish a message
    5. Ack or Nak depending on if the subscriber got or did not get the message.
    For the Subscriber:
    1. Connect to a broker [create it, if it does not exist]
    2. Subscribe to the broker
    3. Subscribe to the Queue
    4. Show an received messages on the console.
    Here are the command line params for both the Publisher and subscriber:
    runPub 127.0.0.1:7676 myTestBroker myQueue "this is my message"
    runSub 127.0.0.1:7676 myTestBroker myQueue
    Please tell me if there are similar java code that will do all this and work with ANY JMS compatible client. i.e. I should not have to use the Admin tool of any JMS Server (MQSeries, iPlanet, SonicMQ etc etc). The code should follow the JMS spec and do this programmatically.
    Thank you very very much in advance for doing this great favor.
    With regards,
    Amir.

    Thanks a lot for that hint. I think that's a great tutorial for a beginner. I could compile those sample codes from chapter 4 with out any problem, but could not run it. I also installed j2sdkee1.3.1 and updated my classpath according to the spec. But when I tried to run the "j2ee -verbose" command it was giving me the following error message:
    ERROR: Set J2EE_HOME before running this script.
    Any advise for me that I should follow next. Thanks again.

  • Mappingtool generates bad DDL for sybase (J2ee tutorial)

    Running the mappingtool on the J2EE tutorial app (3.0.0RC1) generates bad
    DDL for sybase. It's trying to create a table with a column of type
    "IndexName":
    C:\devtools\kodo\samples\j2ee>mappingtool -a refresh package.jdo
    0 INFO [main] kodo.Tool - Mapping tool running on type "class
    samples.j2ee.Car" with action "refresh".
    0 INFO [main] kodo.Tool - The tool is now reading existing schema
    information; this process may take some time. En
    able the kodo.jdbc.Schema logging category to see messages about schema
    data. Also see the -readSchema tool flag.
    3716 INFO [main] kodo.Tool - Recording mapping and schema changes.
    Exception in thread "main" kodo.util.FatalException:
    com.solarmetric.jdbc.ReportingSQLException: Can't specify a length
    or scale on type 'IndexName'.
    {stmnt 7576378: CREATE TABLE CAR (COLOR IndexName(255) NULL, JDOCLASS
    IndexName(255) NULL, JDOID NUMERIC(38) NOT NULL,
    JDOVERSION INT NULL, MAKE IndexName(255) NULL, MODEL IndexName(255) NULL,
    YEAR0 IndexName(255) NULL, UNQ_INDEX NUMERIC I
    DENTITY UNIQUE, CONSTRAINT P_CAR PRIMARY KEY (JDOID))} [code=2716,
    state=ZZZZZ]
    NestedThrowables:
    com.solarmetric.jdbc.ReportingSQLException: Can't specify a length or
    scale on type 'IndexName'.
    {stmnt 7576378: CREATE TABLE CAR (COLOR IndexName(255) NULL, JDOCLASS
    IndexName(255) NULL, JDOID NUMERIC(38) NOT NULL,
    JDOVERSION INT NULL, MAKE IndexName(255) NULL, MODEL IndexName(255) NULL,
    YEAR0 IndexName(255) NULL, UNQ_INDEX NUMERIC I
    DENTITY UNIQUE, CONSTRAINT P_CAR PRIMARY KEY (JDOID))} [code=2716,
    state=ZZZZZ]
    at kodo.jdbc.meta.MappingTool.record(MappingTool.java:431)
    at kodo.jdbc.meta.MappingTool.run(MappingTool.java:790)
    at kodo.jdbc.meta.MappingTool.main(MappingTool.java:729)
    NestedThrowablesStackTrace:
    com.solarmetric.jdbc.ReportingSQLException: Can't specify a length or
    scale on type 'IndexName'.
    {stmnt 7576378: CREATE TABLE CAR (COLOR IndexName(255) NULL, JDOCLASS
    IndexName(255) NULL, JDOID NUMERIC(38) NOT NULL,
    JDOVERSION INT NULL, MAKE IndexName(255) NULL, MODEL IndexName(255) NULL,
    YEAR0 IndexName(255) NULL, UNQ_INDEX NUMERIC I
    DENTITY UNIQUE, CONSTRAINT P_CAR PRIMARY KEY (JDOID))} [code=2716,
    state=ZZZZZ]
    at
    com.solarmetric.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:67)
    at
    com.solarmetric.jdbc.LoggingConnectionDecorator.access$400(LoggingConnectionDecorator.java:19)
    at
    com.solarmetric.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConne
    ctionDecorator.java:506)
    at
    com.solarmetric.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:125)
    at kodo.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1042)
    at kodo.jdbc.schema.SchemaTool.createTable(SchemaTool.java:803)
    at kodo.jdbc.schema.SchemaTool.add(SchemaTool.java:334)
    at kodo.jdbc.schema.SchemaTool.add(SchemaTool.java:186)
    at kodo.jdbc.meta.MappingTool.record(MappingTool.java:364)
    at kodo.jdbc.meta.MappingTool.run(MappingTool.java:790)
    at kodo.jdbc.meta.MappingTool.main(MappingTool.java:729)
    Anyone else seen this? It works ok with Hypersonic (though i can't get the
    tutorial app to run with hypersonic - see my earlier post).
    Alex.

    Some bugs in RCs sometimes don't make it into Bugzilla as it is a
    release candidate and not production quality.
    I would reocmmend upgrading as it fixes a number of major bug fixes and
    you should be able to use the same eval key.
    Alex Robbins wrote:
    Abe White wrote:
    I should also have asked: what JDBC driver are you using?Hi Abe,
    I haven't tried with RC2 - has this been fixed in RC2? I didn't find this
    bug on bugzilla.
    I'm using Sybase JConnect JDBC driver (com.sybase.jdbc2.jdbc.SybDriver in
    jconn2.jar) - looks like this is the version:
    jConnect (TM) for JDBC(TM)/5.5(Build 25008)/P/JDK12/Tue May 29 14:37:46
    2001
    Should I upgrade from RC1 to RC2, and if so, can I continue to use the
    same eval license key or can i download a new one?
    thanks,
    alex
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Who has read J2EE tutorial, please explain to me.

    The Converter bean example in J2EE tutorial....
    Why ConverterHome can refer to Converter without importing Converter first?

    * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
    * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    import java.math.*;
    public interface Converter extends EJBObject {
    public BigDecimal dollarToYen(BigDecimal dollars) throws RemoteException;
    public BigDecimal yenToEuro(BigDecimal yen) throws RemoteException;
    import java.io.Serializable;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface ConverterHome extends EJBHome {
    Converter create() throws RemoteException, CreateException;
    The above code is excerpt from the tutorial sample files.
    The problem is that these two classes are not in the same source file. They cannot be since there can be one and only one public class in a source file.
    So how come ConverterHome can refer to Converter without import?

  • Re. J2EE Tutorial - Setting

    Hi,
    I am familiar to J2EE, but new to the new technlogies & working wth IDEs. I know this is not the right forum for my question, but i didn't find the best forum for my question. I have put the same question in J2EE SDK, so please ignore in that forum.
    I am learning with J2EE Tutorial with NetBeans. I create the examples on myself as mentioned in the tutorial. Currently, i m working on savingsAccount EJB. My problem is, on creating DB.
    I write
    asant -buildfile create-db.xmlas mentioned in tutorial.
    My root folder is D:\Trupti\Tutorials\J2EE-NB TUTORIAL\Projects
    I copied the common.properties & database.properties in my root folder. I needed to change my appserv folder, i did. Now still what is missing, y does it give this error msg. Where am i going wrong. If anybody can help would be really appreciative.
    On Dos prompt it gives as -
    D:\Trupti\Tutorials\J2EE-NB TUTORIAL\Projects\savingsAccount>asant -buildfile cr
    eate-db.xml
    Buildfile: create-db.xml
    startDB:
         [java] Server started, listening on port 9092, display level: 0 ...
    run:
         [java] *****************************************************************
         [java] -driver     com.pointbase.jdbc.jdbcUniversalDriver
         [java] -url        jdbc:pointbase:embedded:sample
         [java] -script     <none>
         [java] -user       PBPUBLIC
         [java] -password   PBPUBLIC
         [java] -autocommit true
         [java] -prompt2    true
         [java] -spoolfile  <none>
         [java] -silent     false
         [java] *****************************************************************
         [java] Database SAMPLE does not exist or cannot be found in database home \
    pointbase\databases specified either specify database.home=<folder> in pointbase
    .ini or use the <URL>;database.home=<folder> to indicate the database folder. po
    intbase.ini should be available in the current folder or you can specify the loc
    ation for pointbase.ini with java -D:property=value where "property" is pointbas
    e.ini and "value" is <path>pointbase.ini.
         [java] Java Result: -1
    BUILD SUCCESSFUL
    Total time: 3 seconds
    D:\Trupti\Tutorials\J2EE-NB TUTORIAL\Projects\savingsAccount>I hope i get some solution to it asap. If anybody has idea, which is the right forum for this question, please inform me.
    Thanks
    Trupti

    Well Lan, Yes I am using J2EE 1.4 Tutorial with Netbeans Version - the tutorial is specially designed to work with NetBeans & Sun AppSer.
    The tutorial says to run this command on command line. Here is the
    text from the tutorial that explains steps to create database:-
    Running the SavingsAccount Example
    Before you run this example, you have to create the database and deploy the
    SavingsAccount.jar file.
    Creating the Sample Database
    The instructions that follow explain how to use the SavingsAccountBean example
    with PointBase, the database software that is included in the Application
    Server bundle.
    1. In the IDE, choose Tools��PointBase Database��Start Local PointBase Database.
    2. Create the database tables by running the create.sql script.
    a. Make sure that the appsrv.root property in your
    <INSTALL>/j2eetutorial14/examples/ file points to the location of
    your local Application Server installation. ********* HERE MY FOLDER POINTS TO THE SERVER ************
    b. In a terminal window, go to this directory:
    <INSTALL>/j2eetutorial14/examples/ejb/savingsaccount/
    c. Type the following command, which runs the create.sql script:
    asant -buildfile create-db.xml
    3. In the Runtime window, expand the Databases node, right-click the
    jdbc:pointbase:server://localhost:9092/sun-appserv-samples
    node, and choose Connect. Type pbpublic as the password and click OK.
    Once the connection is established, expand the connection node�fs Tables node. There should be a node for the SAVINGSACCOUNT table.
    iS THEIR ANY OTHER WAY to run the create.sql script directly.
    Thanks
    Trupti

Maybe you are looking for