FileDocCategorySizeDatePackage
ClassNotFound.javaAPI DocGlassfish v2 API3663Fri May 04 22:34:08 BST 2007com.sun.enterprise.tools.verifier.tests.persistence

ClassNotFound

public class ClassNotFound extends com.sun.enterprise.tools.verifier.tests.VerifierTest implements com.sun.enterprise.tools.verifier.tests.VerifierCheck
The names of classes specified in persistence.xml must be loadable. TopLink simply ignores if class could not be loaded. So we need this test.
author
Sanjeeb.Sahoo@Sun.COM

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.Descriptor descriptor)

        Result result = getInitializedResult();
        addErrorDetails(result, getVerifierContext().getComponentNameConstructor());
        result.setStatus(Result.PASSED);
        final PersistenceUnitDescriptor pu = PersistenceUnitDescriptor.class.cast(descriptor);
        for(String className : pu.getClasses()) {
            try {
                Class.forName(className, false, getVerifierContext().getClassLoader());
            } catch (ClassNotFoundException e) {
                result.failed(smh.getLocalString(getClass().getName() + "failed1",
                        "Class [ {0} ] could not be loaded", new Object[]{className}));
            } catch (NoClassDefFoundError e) {
                result.failed(smh.getLocalString(getClass().getName() + "failed2",
                        "Class [ {0} ] could not be loaded " +
                        "because a dependent class could not be loaded. See reason:\n [ {1} ]",
                        new Object[]{className,e.getMessage()}));
            }
        }
        return result;