Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

J2EE Help

  Asked By: Kiswar    Date: Jul 29    Category: Java    Views: 825

I am trying to build the sample files in J2EE
(The one that comes along with J2EE 1.3). I am
following the instructions there in how to build the files
using Ant. I did suceed in building a couple of them
except the Converter application. Its giving me the
error for EJBObject. Actually when its trying to import
EJBObject. So, what did I do wrong. Are there any particular
API that I have to import, set as my path etc etc??



2 Answers Found

Answer #1    Answered By: Brian Ross     Answered On: Jul 29

So, what was the problem and how did you fix it. The purpose of this forum is
to share the wealth

Answer #2    Answered By: Heidi Larson     Answered On: Jul 29

The problem was with the code that came along
with the tutorial package.Who could have imagined!!!
Just had to comment out 2 import
statements. Problems were there with the converter  application and the
confirmer application. The code that needed to be commented
out were in ConverterClient.java and
ConfirmerClient.java In ConverterClient.java , the code looks somewhat
like this. ======== 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"); =============== I commented out those
2 lines and it compiled,
without errors. Likewise for
ConfirmerClient.java Also there are errors in the bookstore application.
============== [javac] Currency c =
(Currency)session.getAttribute("currency"); [javac] ^ [javac]
.java:47: reference to Currency is ambiguous, both class
util.Currency in util and class java.util.Currency in java.util
match [javac] Currency c =
(Currency)session.getAttribute("currency"); [javac] ^ [javac] 2
============== Solved the above with util.Currency c =
(util.Currency)session.getAttribute("currency"); How could sun ever
publish these
materials without testing it on different
platforms?? ========================== Still I am faced with another
problem, tried to
compile the example like the converter example. I did
according to the tutorial but am having problems running
it. Tried runclient -client ConverterApp.ear -name
ConverterClient -textauth Yes I do have the ConverterApp.ear
and ConverterAppClient.jar files. Can someone
help. They mentioned setting appcpath, but the compiler
gives me a syntax error: usage : blah blah
blah... Also I am typing this on my
c:\j2eetutorial\examples\ejb\src\converter directory. Using the "crash
resitant" ;D
Windows 98 as my platform. A friend of mine suggested me
to use an IDE to solve it, but I rather want to go
with the commandline for now. I guess I am just to
lazy to think, my head hurts..... Can someone help

Didn't find what you were looking for? Find more on J2EE Help Or get search suggestion and latest updates.