I am using MyEclipse 5.1.1 and Microsoft SQL 2000.
I was able to get the HelloWorld with the Hibernate Core on page 46 to work and the HelloWorld to work with the annotations page 69 to work.
I was not able to get the HelloWorld to work on page 85.
This is the error:

// Deploy all EJBs found on classpath (fast, scans build directory)
// This is a relative location, matching the substring end of one
// of java.class.path locations. Print out the value of
// System.getProperty("java.class.path") to see all paths
EJB3StandaloneBootstrap.scanClasspath("HelloWorldEJB3/bin");
try
{
// Create InitialContext from jdni.properties
InitialContext initialContext = new InitialContext();

It would be great if you could use the Preview feature of this forum and format your code properly with code tags in the future. Nobody can read what you write.

Did you type in the code from the book or did you download and execute the ready-made examples? If you did not download the examples, please do so, run them (there shouldn't be any problem), and then compare them to what you did.

_________________JAVA PERSISTENCE WITH HIBERNATEhttp://jpwh.orgGet the book, training, and consulting for your Hibernate team.

// Deploy all EJBs found on classpath (fast, scans build directory) // This is a relative location, matching the substring end of one // of java.class.path locations. Print out the value of // System.getProperty("java.class.path") to see all paths EJB3StandaloneBootstrap.scanClasspath("HelloWorldEJB3/bin");

The second line looks for the "HelloWorldEJB3/bin" directory. If nothing is deployed, you probably have given your directory a different name or it isn't in the classpath of the test-run in your build.xml. Comment out this line and use the first line to scan every location in your classpath (slower).

_________________JAVA PERSISTENCE WITH HIBERNATEhttp://jpwh.orgGet the book, training, and consulting for your Hibernate team.

// Deploy all EJBs found on classpath (fast, scans build directory) // This is a relative location, matching the substring end of one // of java.class.path locations. Print out the value of // System.getProperty("java.class.path") to see all paths EJB3StandaloneBootstrap.scanClasspath("HelloWorldEJB3/bin");

The second line looks for the "HelloWorldEJB3/bin" directory. If nothing is deployed, you probably have given your directory a different name or it isn't in the classpath of the test-run in your build.xml. Comment out this line and use the first line to scan every location in your classpath (slower).

Hi:

I tried the above suggestions it gave me the same error.
I typed in the code instead of using the one from download.
I changed to HelloWorldEJB3/bin because my project was called HelloWorldEJB3.

I followed your suggestions and use the download code for helloworld-ejb3.

I ran it in MyEclipse 5.1 and I get the following error:
Name Not Found Exception

on the line 30:
(MessageHandler) initialContext.lookup("MessageHandlerBean/local");

It shows it is using jdk 1.5. Is there something I have to set to run the Ant file successfully for jdk 1.5. The error looks like it didn't recognize the anntotations syntax as if it is not using jdk 1.5 even though it is.

If 'ant run' complains about illegal characters in the source, you are not using JDK 1.5. As far as I know, Ant picks up the JDK to use from the JDK_HOME variable. This is probably set to a different JDK than the one you get when you call 'javac -version'. Your system configuration should be checked.

Try to compile any class with an annotation and a very simple Ant script before you try other peoples code. Make sure your Ant setup works first.

_________________JAVA PERSISTENCE WITH HIBERNATEhttp://jpwh.orgGet the book, training, and consulting for your Hibernate team.

If 'ant run' complains about illegal characters in the source, you are not using JDK 1.5. As far as I know, Ant picks up the JDK to use from the JDK_HOME variable. This is probably set to a different JDK than the one you get when you call 'javac -version'. Your system configuration should be checked.

Try to compile any class with an annotation and a very simple Ant script before you try other peoples code. Make sure your Ant setup works first.

Hi:

You're right!!!. My JAVA_HOME variable was pointing to jdk 1.4. I changed it to point to JDK 1.5.

I ran the following ant command in dos-prompt but I get the same error as before when I run at MyEclipse 5.1.1:

Now you have your code compiling with the correct JDK, have you tried what Christian suggested about getting it to scan the whole class path.

Like you, I had the same issue.
So, as Christian said, I used the full classpath scan and it started working, so I knew where the problem lay.
Finally, I printed out the result of System.getProperty("java.class.path") and saw that the require paths began with the project name already, so

// Deploy all EJBs found on classpath (fast, scans only build directory) // This is a relative location, matching the substring end of one of java.class.path locations! // Print out System.getProperty("java.class.path") to understand this... EJB3StandaloneBootstrap.scanClasspath();

have you resolved your problem ?
I'm still stuck with it, but maybe I can help you a little :)
Your problem is in "naming".. you typed "adaptor" insted of "adapter"!
The correct name for LocalTxDataSource is:

org.jboss.resource.adapter.jdbc.local.LocalTxDataSource

Check your xml.
If, after making the correction, you find yourself stuck with the same error, then check your classpath and be sure you have added all the jars from the "embedded" version of jboss ejb3 container ( jboss-EJB-3.0_Embeddable_ALPHA.zip archive downloaded from labs.jboss.org site).

After that, you'll find yourself stuck again where I am at the moment: