Adam Altmann

Greenhorn
+ Follow
since Nov 15, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adam Altmann

Heh, I'm sure you people are growing tired of me by now, but here's a new problem! (I know you're as excited as I am)
I believe I actually got it to run by using the command:
java -cp %CLASSPATH%;AdviceAppClient.jar;. AdviceClient
Only now when it runs (if it is indeed running, though I believe it is), I get this madness spit back at me:

java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemExceptio
n(ShutdownUtilDelegate.java:137)
at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:21)
at AdviceClient.main(AdviceClient.java:10)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed:
No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more

I am seriously going crazy here. I moved elements around in my PATH list, and it seems to compile now, if I use this command:
javac -classpath %CLASSPATH%;AdviceAppClient.jar AdviceClient.java
An AdviceClient.class shows up in the directory, so I assume it's working. However, when I go to run it, I get:
Exception in thread "main" java.lang.NoClassDefFoundError: AdviceClient
Words cannot express how happy this makes me. I appreciate the help, I really do. Any ideas what I need to do now? I would hope I'm getting closer.
When I use that command, I get:
error: cannot read: AdviceClient.java
Ack! This is SO disappointing, I've got new problems...
I've gotten my Bean compiled fine, and have gone through the deploytool just fine. "Deployment of AdviceApp is complete." Now all I need is the client.
I've written it, it's flawless code-wise, and in the directory it's supposed to be in, but when I try to compile with the following:
javac -classpath {$CLASSPATH}:AdviceAppClient.jar AdviceClient.java

I get six fabulous compiler errors:
package headfirst does not exist
package javax.ejb does not exist
cannot resolve symbol
symbol: class AdviceHome
location: class AdviceClient
..and so on.
So I can't figure out why I can compile everything just peachy from c:\projects\advice\src, but not compile from c:\projects\advice.
I'm sure I'm missing something simple, just as I was earlier. This is getting to be pretty discouraging. Again, thanks for the continued help. I really appreciate it!
(I'm running XP Pro, if that helps any.)
[ March 11, 2004: Message edited by: Adam Altmann ]
I believe I've figured it out. Thanks Murat. I was adding the j2ee.jar to PATH and had no CLASSPATH variable. I just created one and it seems to have worked.
I have added that exact line to my PATH variable and it's still not working. Other ideas?
Thanks.
Thanks, I just added the location(s) to PATH. I can get: j2ee -verbose to work now (whooo!), and I can get javac to actually compile by typing the exact commands from page 30 into the book (I'm making progress!), but I'm getting compiler errors from seemingly anything to do with EJB.
For example:
cannot resolve symbol
symbol: class EJBObject
package javax.ejb does not exist

...and so on. Any ideas? Im sure I'm missing something simple, but it's not the code. I know that much.
Thanks for your help so far!
[ March 11, 2004: Message edited by: Adam Altmann ]
I'm having a heck of a time getting the very first "AdviceBean" project up and running. I have everything written and ready to go, but from page 30 onwards I can't accomplish a single task. I realize that I am quite possibly not-the-brightest-guy, so I come seeking help:
Firstly, I do not understand the:
javac -d ../classes headfirst/*.java
command. I can only call javac from C:\j2sdk1.4.2_03\bin directory, and I'm just not "getting" what I'm supposed to be doing here. I'm not super-fluent on command line stuff, as I've been compiling and running all my programs from NetBeans and Textpad for the most part. So, again I make a cry for help.
Secondly, I cannot run the following command (page 31) either:
j2ee -verbose
I get the following error message:
'j2ee' is not recognized as an internal or external command, operable program, or batch file.
I have my Sun One Application server up and running. I can do that much, though I'm not so sure I should even be doing that as it hasn't been mentioned to do so.
I want to weep! This stuff looks like a lot of fun, and I can't even get started! I've been monkeying around for a couple hours now, with no visual result...and so I plead with you to set me upon the path to EJB goodness!
(I have no doubt that I'll feel like a total wiener once this has been explained to me.)
Did I mention I need help?
PS - I plan on shooting for the SCBCD next. I'm wondering, however, if I should shoot for the SCWCD first. Any opinions? Are they equally difficult? Which will give me a better chance at landing a job? Thanks again.
20 years ago
Just got home from the testing center...
I answered 50 out of 61 questions correctly for 81%. Here's the section analysis:
Declarations and Access Control 62%
Flow Control, Assertions, and Exception Handling 66%
Garbage Collection 66%
Language Fundamentals 70%
Operators and Assignments 100%
Overloading, Overriding, Runtime Type and Object Orientation 100%
Threads 100%
Fundamental Classes in the java.lang package 83%
The Collections Framework 100%

Now, I was shooting for 52%, and was hoping for about 70%, so I can't complain. I actually felt that I might have gotten more correct, as the questions didn't seem as difficult as the prep questions I've done. I also had enough time to go through the questions twice, so I did. I didn't sleep well at all last night, so that might have played a part in missing some things I might have otherwise caught.
I spent a good deal of time on exception handling, threads, inner classes (with much time spent with anonymous inner classes, which I don't remember seeing on my exam...which doesn't mean they weren't there...I've skipped right over them a few times in practice), and especially the collections framework, as I felt those were my weakest areas. I was thankful for the collections questions I got,as I knew that I knew them. I'm miffed at my Garbage Collection score, but happy with the Threads score. All in all, I'm exceptionally pleased...though looking back, I have no idea what I got incorrect.
I doubt I would have done so well without this place, you folks are great.
How I studied:
I used the Sierra/Bates book almost exclusively. I read through the entire book once, then went through each chapter and took notes in a notebook. Then I made out 3x5 "flashcards" out of just about everything in the chapter. I retained a lot of information just by writing everthing out by hand twice. I have other java books, so if ever something wasn't clear I'd turn to them as backup. I did the Rules Roundup about eleventy billion times, at first I was doing horribly, but by the end I would rarely miss a question. Once I "finished" the book, I went to work with the flashcards. I'd take a handful of them at a time, and go through, placing a pile off to the side of the ones I knew without question. I kept cycling through them in this way until I knew them all. I also made sub-piles of flashcards from topics I knew I had trouble with. By shuffling the cards together randomly in stead of keeping them in sections (by chapter, etc), it really forced me to remember java as a whole, instead of just one part of it at a time. I also went back to the book to read some chapters every so often.
Anyway, I've passed it...and I truly want to thank everyone here.
Now I'm going to go take a nap.
20 years ago
Hello,
So I'm taking the SCJP 1.4 Exam in about 12 hours. It's quite terrifying really, but I'm determined to take it...mainly because I don't think I can take another day of studying for it. This may not be the wisest decision I've ever made, but I assure you I've made worse. Ok, ok, enough rambling and on to my question:
I've completed both of the MasterExams that came with the Sierra/Bates book, and scored in the 70%-75% range on both. Now, the MasterExam software told me both times that I FAIL, and there was much weeping over keyboards. However, passing the actual Sun exam is 52% is it not? I mean, even if I lose sleep tonight from sobbing into my pillow due to the harsh criticism, I doubt that I'll go from getting over 2/3 of the questions correct to getting more than half of them wrong.
Should I be worried here? (Please note that I will be worried anyway, I'm just curious as to what degree of worridom I should be striving for.)
Thanks.
I wrote the following program:
public class Test{
public static void main(String[] args){
int A = -1;
A = A >>> 8;

byte B = -1;
B = (byte)(B >>> 5);

int C = -1;
C = C >> 5;

int D = -1;
D = D >>> 32;

System.out.println("A = " + A);
System.out.println("B = " + B);
System.out.println("C = " + C);
System.out.println("D = " + D);
}
}
And got these results:
A = 16777215
B = -1
C = -1
D = -1

Honestly, this makes no sense to me. I would think that C is the only right answer, since >>> is the unsigned right shift (it fills the bits to the left with 0) and >> fills the left with whatever the sign bit is. In Two's Complement, negative numbers have a 1 as their Most Significant Bit. Since each of these start as negative (with MSB of 1), only choice C should stay negative, since it will be the only one left with a MSB of 1 (because A, C, D fill with 0).
Can someone please explain this? I'm thoroughly confused.
public void actionPerformed(ActionEvent e)
{
int key = (Integer.parseInt(jtfIndex.getText()));
int[] list = new int[100];
int result = linearSearch(key, list);
...

You're shadowing "list" (you've got two variables named "list"). You're performing the linearSearch on an array you've just created, not on the one you've populated with random numbers. Each element in THAT array (the "list" variable shown above) has been given the default value for int, which is zero.
If you run the program and put a zero in the Array Index box, it'll match Array Element zero, since it's the first element of the array, and it has a zero in it.
20 years ago
As far as I know, there's only ever one main method.
Yes, you can access functions in one class from another class. It just depends on which access modifiers (Public, Protected, Private, (Default)) are in place.
20 years ago
I believe it's just passing whatever object called the method, into that method as it's argument. So, if the Hai method looks like:
public void Hai (Object ob){
//Do some nifty stuff to ob
}
Then when you call Hai(this) from <whateverObject>, then (a copy of the referece to) <whateverObject> is passed in to Hai (which is then used as "ob" inside the method.) Again, I believe this is correct, but I'm not 100%.
20 years ago