Hi Siegfried,

Constructed jar looks fine. The deployment error is rather strange. Obviously the lookup and undeploy won't succeed until the deploy works, so we'll tackle that first.

The error "Check that the directory is writable and that there is enough disk space" is throw by the VM when we attempt to write your jar to the apps directory. Not sure what approach to take other than to begin eliminating possible causes.

I've hacked up a little small java class that will help us check the status of the directory you are trying to write to. With OpenEJB running just as when you try to deploy, run this program to check the write access of the apps directory. Please send back the output.


import java.io.*;
import java.text.*;
import java.util.Date;

public class WriteCheck {

    public static void main(String[] args) throws Exception {

String[] dirs = {"temp", "temp", "download", "openejb.apache.org_ejb3-tutorial", "standalone-server", "openejb-3.1", "openejb-3.1", "apps"};

        File appsPath = new File("C:");

        // Check each part of the path individually
        for (String dir : dirs) {
            appsPath = new File(appsPath, dir);
if (!appsPath.exists()) throw new Fail("Does not exist: " + appsPath.getPath()); if (!appsPath.isDirectory()) throw new Fail("Is not a directory: " + appsPath.getPath());
        }

        System.out.println("Apps path is ok: " + appsPath.getPath());

        // List the files in the apps dir
        for (String s : appsPath.list()) {
            System.out.println(" - " + s);
        }

        // Attempt to write a couple files to the apps dir
        writeAndDelete(appsPath, "test.txt");

        writeAndDelete(appsPath, "hello.jar");

    }

private static void writeAndDelete(File appsPath, String fileName) throws Exception {
        File file = new File(appsPath, fileName);
        OutputStream out = new FileOutputStream(file);
        try {
            // Write something simple like the date and time
            DateFormat df = SimpleDateFormat.getDateTimeInstance();
            out.write(df.format(new Date()).getBytes());
            out.flush();
        } catch (IOException e) {
            throw new Fail("Cannot write to file: "+file.getPath(), e);
        } finally {
            out.close();
        }

        try {
            file.delete();
        } catch (Exception e) {
            throw new Fail("Cannot delete file: "+ file.getPath(), e);
        }

        System.out.println("Write and delete ok: "+file.getPath());
    }

    public static class Fail extends Exception {
        public Fail(String message, Throwable cause) {
            super(message, cause);
        }

        public Fail(String message) {
            super(message);
        }
    }
}


This should hopefully help us see what might be going on.

Thanks, Siegfried!

-David


On May 21, 2009, at 6:16 PM, siegfried wrote:

I'm trying to follow the example at
http://openejb.apache.org/hello-world.html on windows XP using cmd.exe or
cygwin bash.





Here are my results:



javac -g   *.java -d .

jar cvf hello.jar org

adding: META-INF/ (in=0) (out=0) (stored 0%)

adding: META-INF/MANIFEST.MF (in=56) (out=56) (stored 0%)

adding: org/ (in=0) (out=0) (stored 0%)

adding: org/acme/ (in=0) (out=0) (stored 0%)

adding: org/acme/Hello.class (in=203) (out=168) (deflated 17%)

adding: org/acme/HelloBean.class (in=470) (out=308) (deflated 34%)

adding: org/acme/HelloClient.class (in=1481) (out=797) (deflated 46%)

Total:

------

(in = 2198) (out = 2095) (deflated 4%)

/usr/bin/find . -name \*.jar

./hello.jar

C:\temp\temp\download\openejb.apache.org_ejb3-tutorial\standalone- server\ope
nejb-3.1\openejb-3.1/bin/openejb deploy hello.jar

Directory does not exist:
C:\temp\temp\download\openejb.apache.org_ejb3-tutorial\standalone- server\ope
nejb-3.1\openejb-3.1\apps

Unable to copy application to
"C:\temp\temp\download\openejb.apache.org_ejb3-tutorial\standalone- server\op enejb-3.1\openejb-3.1\apps\hello.jar". Check that the directory is writable
and that there is enough disk space.

Exception in thread "main" javax.naming.NameNotFoundException:
/HelloBeanRemote does not exist in the system.  Check that the app was
successfully deployed.

           at
org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:276)

           at javax.naming.InitialContext.lookup(Unknown Source)

           at org.acme.HelloClient.main(HelloClient.java:19)


Reply via email to