[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Naming objects in WizardStore



Hi,
  I was just trying to get a simple app working with Ozone 0.4 dev 3.  I
got the following exception when I tried to create a named object:

[warn] (561) Transaction: nameObject()
    java.lang.IllegalArgumentException
	at java.util.Hashtable.<init>(Comp
            iled Code)
	at java.util.Hashtable.<init>(Hashtable.java)
	at org.ozon
            eDB.DxLib.DxHashMap.<init>(DxHashMap.java:30)
	at org.ozoneDB.DxLib.Dx
            HashMap.clone(DxHashMap.java:35)
	at org.ozoneDB.core.wizardStore.Wiza
            rdStore.nameContainer(WizardStore.java:260)
	at org.ozoneDB.core.Trans
            action.nameObject(Transaction.java:461)
	at org.ozoneDB.core.Transacti
            on.createObject(Transaction.java:351)
	at org.ozoneDB.core.DbRemote.Db
            CreateObj.perform(DbCreateObj.java:36)
	at org.ozoneDB.core.Transactio
            n.performCommand(Compiled Code)
	at org.ozoneDB.core.TransactionManage
            r.completeTransaction(TransactionManager.java:245)
	at org.ozoneDB.cor
            e.TransactionManager.handleCommand(TransactionManager.java:229)
	at or

g.ozoneDB.core.InvokeServer.handleClientEvent(InvokeServer.java:58)
	a
            t org.ozoneDB.DxLib.net.DxMultiServerClient.run(Compiled Code)
	at jav
            a.lang.Thread.run(Thread.java)

Is this a known problem with naming objects or is it my setup?

On a related note, I had to move the classicStore package out of the source
tree because it wouldn't compile.  I didn't get any compile errors, and it
doesn't seem to be the problem above.

Finally, I'm using a slightly different version of UnexpectedException
which you might like.  It works well when re-throwing other exceptions.
Here is the code:

public class UnexpectedException extends RuntimeException {

	private static final boolean printMessage = false;
	private static final boolean flushStreams = false;

    public UnexpectedException() {
    	if (flushStreams) {
    		System.out.flush();
    		System.err.flush();
    	}
        }

    public UnexpectedException (String msg) {
        super (msg);
        if (flushStreams)
        	System.out.flush();
        if (printMessage) {
        	System.err.println(getMessage());
        }
        if (flushStreams)
        	System.err.flush();
        }
 
     public UnexpectedException (java.lang.Throwable t) {
     	this(makeStringFromThrowable(t));
		}

	protected static final String makeStringFromThrowable(java.lang.Throwable
t) {
		if (t instanceof UnexpectedException) {
			return "Rethrowing: " + t.getMessage();
		} else {
			java.io.CharArrayWriter myStream = new java.io.CharArrayWriter();
			java.io.PrintWriter pStream = new java.io.PrintWriter(myStream);

			t.printStackTrace(pStream);
			pStream.close();
		
			return "Throwable: " + t.getClass().getName() + "\n" +
				"at: " + myStream.toString() + "\n" +
				"Message: " + t.getMessage() + "\n";
		}
	}
	
	public final boolean isPrintingMessages() {
		return printMessage;
	}

    }

later,

\x/ill          :-}