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
I have been able to connect my Win XP netbook to my secure wireless network at home, other people's networks and public networks like the library and McDonalds. This week I'm away from home and discovered that while I can still connect to a number of [More]
i donwloaded yosemite os x yesterday; and now itunes won't open at all. what to do? (i also downloaded, and re-downloaded, the latest itunes.)huh. created a new account, and then itunes opened, without my music. then went back to my old account and n [More]
I am trying to get my applet to use to use six buttons to change a text field but only four work. the two on the bottom right only change the bottom right text where as they should also change the top right text field along with the other four button [More]
Hi, I gave a presentation last night on my MacBook Pro (2011), OS X Yosemite, and when I tried to connect the laptop to an external projector all of my videos stopped working!  I had a blank screen and audio only.  What happened? I had a VGA cord for [More]
HI all, I want to print an member List for my organization in address book with a Custom Sort Order.   I don't know how to do it.   Here is the thing:  I made a contact list of the members of the organization so that I can have on File.   Select my C [More]
i arranged a series of photos on my Ipad into an "album". I would now like to have that show up in Iphoto on my macbook, to build and order a hard-copy book, not a digital book. How can I get the album from my Ipad to Iphoto on the macbook?Backi [More]
Hi, I am trying to book a slot for 1Z0-051 exam Oracle Database 11g: SQL Fundamentals I through Online.. But the price is little higher than what I expected. Can I find coupons by chance.? Does anybody have any idea?873476 wrote: Hi, I am trying to b [More]
I have been able to get my application to launch several times successfully. Late Friday and today, however, when I start up a new deployment of the application to view further changes I've made with a a fresh war file, I get a Page Not Found error w [More]
Now when I tell iMac to sleep the disc never stops. Also when I connected  my iPhone it does not start iTunes even though it is ticked.The 'sleep' issue has been resolved by turning off all sharing in sytem preferences. The issue with iTunes continue [More]
public void PrintFaturen(int faturaID) using (var db = new blejshpejtDBEntities1()) var mFatura = db.Shitjas.Single(c => c.ShitjaID == faturaID); StringBuilder permbajtja = new StringBuilder(); foreach (var item in mFatura.ShitjaDetajets) if (item is [More]