Sitemap

Amicuk Programming Answers

J2EE Tutorial sample codes question

-0001-11-30   Views:1

Advertisement

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 Convert

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

The replay answer
Advertisement
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

Go to See the other 3 answers

J2EE Tutorial sample codes question

Category:DefaultRelease time:-0001-11-30Views:130

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 Convert[More]

Report Engine SDK sample code questions

Category:DefaultRelease time:2015-10-11Views:130

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, alt[More]

Copy Webdynpro Tutorial Sample Code

Category:DefaultRelease time:-0001-11-30Views:130

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. I[More]

Services tutorial sample code

Category:DefaultRelease time:-0001-11-30Views:130

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 wha[More]

Web Server 7.0 Tech preview will not run J2EE tutorial samples

Category:DefaultRelease time:2015-10-11Views:130

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[More]

Core MIDI sample code or tutorial

Category:DefaultRelease time:-0001-11-30Views:130

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 connect[More]

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

Category:DefaultRelease time:2015-10-11Views:130

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 wi[More]

Sun ejb tutorial compilation problem with sample code

Category:DefaultRelease time:2015-10-11Views:130

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 De[More]

Look for JDeveloper Tutorial with samples code

Category:DefaultRelease time:-0001-11-30Views:130

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 Data[More]

JTAPI tutorial and code samples??

Category:DefaultRelease time:-0001-11-30Views:130

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[More]

Tutorial or code sample in creating a .exe for windows

Category:DefaultRelease time:-0001-11-30Views:130

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[More]

Hot
As of yesterday, I am receiving e-mails fine; however, unable to send. Everytime I try to send an e-mail, I get "Sending of message failed. The message could not be sent because the connection to SMTP server (my mail address) timed out. Try again or [More]
Hi there, We have ECC 6.0 and configured with New G/L and document splitting. I am getting error, when I try to settle internal order to AUC (Asset Under Construction). It is giving me Profit Center Balancing error. In Settlment Profile, I have set u [More]
Hi all, I'm using the API to create a large pdf i.e a bundle of quotes. Since I'm using the FOPRocessor(InputStrreams[],Templates[]) to create the PDF, I was wondering if there is a way to create a table of contents using the Outlineprocessor or do I [More]
Hi Oliver, Have you tried using the Test XML tab in the test harness to test the external web service. By using that, you can check the SOAP request sent to the service. Could you please send us the WSDL file and a sample SOAP request sent to the ext [More]
Hi All, I am getting the following error when i am running swing program. I have a large volume of data. My resultset is running upto 2 hours. after 2 hours process is stoped and i got the following error on console.I am using Swing and MS SQL Server [More]
I would like to know what java component should i use to showt he thumbnail of images in the server. I am using netbean 5.5 and i cannot see if there are any suitable java swing component for this purpose. Please advice. n.b. I am writing a java appl [More]
hi, by what t code and how p.o. is created refference to contract. contract is just a memo for long term aggreement.so in SAP can we create p.o. that shows respective contract. Thanks in advance sumit bislaDear, Contracts executed through creation of [More]
Is there an icon in OSX that shows the status of your INTERNET connection? The Airport status Icon shows that when you're connected to a network, but not the internet. Help! ThanksIs there an icon in OSX that shows the status of your INTERNET connect [More]
Lors de la mise à jour 6.7 de Photoshop Camera Raw, j'ai ce message d'erreur: Echec de l'installation. Code d'erreur : U44M1P7 Quelqu'un peut m'expliquer ce que cela veut dire? et pourquoi la mise à jours de certains composants ne se fait pas?The D75 [More]
I upgraded to the new OS for my playbook and evertime I send a message with my work e-mail I get a duplicate message sent. After I press send the message goes to a red X and a top of the message it reads "there was an interruption in sending this mes [More]