FAQ
Hello,

I am trying to load some "jarred" class mappings generated by Cayenne using
the URLClassLoader,
of course if I load all libs into the starting classloader all goes well,
but when I use the URLClassLoader
I receive the following error message suddenly after invoking
"context.performQuery(select1)" :

[v.2.0.4 October 8 2007] No DataMap found, can't route query
org.apache.cayenne.query.SelectQuery@1764be1[root=class ...]

My code:

DataContext context = DataContext.createDataContext();

URLClassLoader urlClassLoader = new URLClassLoader(remoteLibs);
try {
//Class<?> clzz =
Class.forName("org.someproject.SomeClass",true,urlClassLoader);
Class<?> clzz = urlClassLoader.loadClass("org.someproject.SomeClass");
Method m = clzz.getDeclaredMethod("executeCustom", new
Class[]{DataContext.class});
m.invoke(null, new Object[]{context});
} catch (Throwable e) {
e.printStackTrace();
}

Just to run it, where can I declare some local filesystem position to search
for XML data mappings?

P.S.
I noticed FileConfiguration.addResourcePath & co. but it works only if all
libraries are loaded
by the starting classloader

--
View this message in context: http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20654024.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Search Discussions

  • Rigel at Nov 24, 2008 at 5:38 am

    rigel wrote:
    Hello,
    [...]
    Going into the Cayenne source code I notice that the real message thrown by
    EntityResolver.constructCache() is "Failed to load class
    org.someproject.orm.cayenne.SomeEntity:
    org.someproject.orm.cayenne.SomeEntity"
    Solved by myself, just for other people interested to use URLClassLoader
    with Cayenne: replace the bundled "org.apache.cayenne.util.Util" with a
    patched one which uses Class.forName(className) into "getJavaClass()" as
    last chance, instead of "Class.forName(className, true, classLoader)", keep
    it as pre-last chance.

    Bye
    --
    View this message in context: http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20655214.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Andrus Adamchik at Nov 24, 2008 at 7:40 am
    Hi, could you possibly try it with Cayenne 3.0M4? I think it should
    already be fixed there.

    Cheers,
    Andrus
    On Nov 24, 2008, at 7:37 AM, rigel wrote:




    rigel wrote:
    Hello,
    [...]
    Going into the Cayenne source code I notice that the real message
    thrown by
    EntityResolver.constructCache() is "Failed to load class
    org.someproject.orm.cayenne.SomeEntity:
    org.someproject.orm.cayenne.SomeEntity"
    Solved by myself, just for other people interested to use
    URLClassLoader
    with Cayenne: replace the bundled "org.apache.cayenne.util.Util"
    with a
    patched one which uses Class.forName(className) into
    "getJavaClass()" as
    last chance, instead of "Class.forName(className, true,
    classLoader)", keep
    it as pre-last chance.

    Bye
    --
    View this message in context: http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20655214.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Rigel at Nov 24, 2008 at 8:05 pm
    Hi Andrus, first of all thank you for your great work :clap: .


    Andrus Adamchik wrote:
    Hi, could you possibly try it with Cayenne 3.0M4? I think it should
    already be fixed there.
    Yes of course, I try to put my small contribute for what I can.

    This is the output (JDBC driver is the only jar pre-loaded into classpath
    because differently by Cayenne 2 now (DriverDataSource.java:62) does not
    solve the
    class driver):

    Loading lib: http://localhost:80/users/antares/libs/ashwood-2.0.jar
    Loading lib: http://localhost:80/users/antares/libs/asm-3.0.jar
    Loading lib: http://localhost:80/users/antares/libs/asm-commons-3.0.jar
    Loading lib:
    http://localhost:80/users/antares/libs/commons-collections-3.1.jar
    Loading lib: http://localhost:80/users/antares/libs/commons-logging-1.1.jar
    Loading lib:
    http://localhost:80/users/antares/libs/geronimo-jpa_3.0_spec-1.0.jar
    Loading lib: http://localhost:80/users/antares/libs/velocity-1.3.jar
    Loading lib: http://localhost:80/users/antares/libs/cayenne-agent-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/cayenne-client-3.0M4.jar
    Loading lib:
    http://localhost:80/users/antares/libs/cayenne-modeler-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/cayenne-server-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/w3d-base.jar
    Loading lib: http://localhost:80/users/antares/libs/w3d-orm.jar
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    startedLoading
    INFO: started configuration loading.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataDomain
    INFO: loaded domain: dbw3d
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate loadDataMap
    INFO: loaded .
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: loading .
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
    24-nov-2008 20.20.13 org.apache.cayenne.conf.DriverDataSourceFactory load
    INFO: loading driver information from 'dbw3dNode.driver.xml'.
    24-nov-2008 20.20.13
    org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler init
    INFO: loading driver org.postgresql.Driver
    24-nov-2008 20.20.13
    org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler init
    INFO: loading user name and password.
    java.lang.ClassNotFoundException:
    org.apache.cayenne.conf.PlainTextPasswordEncoder
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    org.apache.cayenne.conn.DataSourceInfo.getPasswordEncoder(DataSourceInfo.java:207)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler.init(DriverDataSourceFactory.java:324)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler.startElement(DriverDataSourceFactory.java:191)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.load(DriverDataSourceFactory.java:130)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverDataSourceFactory.java:78)
    at
    org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLoadDelegate.java:299)
    at
    org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:337)
    at
    org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLoader.java:223)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:79)
    at
    org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:164)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:157)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:139)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:119)
    at
    org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:89)
    at
    org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:162)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:65)
    at NetLoader.main(NetLoader.java:76)
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logPoolCreated
    INFO: Created connection pool: jdbc:postgresql://localhost/w3d
    Driver class: org.postgresql.Driver
    Min. connections in the pool: 1
    Max. connections in the pool: 1
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: loaded datasource.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate initAdapter
    INFO: no adapter set, using automatic adapter.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLinkDataMap
    INFO: loaded map-ref: dbw3dMap.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 142 ms.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logQueryStart
    INFO: --- will run 1 query.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection: jdbc:postgresql://localhost/w3d
    Login: postgres
    Password: *******
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.postgres.PostgresAdapter
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logQueryError
    INFO: *** error.
    java.lang.ClassNotFoundException: it.weev.orm.cayenne.dbw3d.matlibs
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.cayenne.util.Util.getJavaClass(Util.java:589)
    at org.apache.cayenne.map.ObjEntity.getJavaClass(ObjEntity.java:271)
    at
    org.apache.cayenne.reflect.PersistentDescriptorFactory.getDescriptor(PersistentDescriptorFactory.java:57)
    at
    org.apache.cayenne.reflect.ClassDescriptorMap.createDescriptor(ClassDescriptorMap.java:129)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.checkDescriptorInitialized(LazyClassDescriptorDecorator.java:51)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.getEntity(LazyClassDescriptorDecorator.java:75)
    at
    org.apache.cayenne.access.trans.SelectTranslator.appendQueryColumns(SelectTranslator.java:267)
    at
    org.apache.cayenne.access.trans.SelectTranslator.buildResultColumns(SelectTranslator.java:240)
    at
    org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:103)
    at
    org.apache.cayenne.dba.postgres.PostgresSelectTranslator.createSqlString(PostgresSelectTranslator.java:32)
    at
    org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:116)
    at
    org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:72)
    at
    org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:58)
    at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:424)
    at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:68)
    at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:397)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:394)
    at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:120)
    at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:317)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
    at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
    at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:65)
    at NetLoader.main(NetLoader.java:76)
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:65)
    at NetLoader.main(NetLoader.java:76)
    Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0M4 May 18 2008
    15:29:33] Query exception.
    at
    org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:551)
    at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:237)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:424)
    at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:68)
    at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:397)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:394)
    at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:120)
    at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:317)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
    at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
    at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:45)
    ... 6 more
    Caused by: java.lang.ClassNotFoundException:
    it.weev.orm.cayenne.dbw3d.matlibs
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.cayenne.util.Util.getJavaClass(Util.java:589)
    at org.apache.cayenne.map.ObjEntity.getJavaClass(ObjEntity.java:271)
    at
    org.apache.cayenne.reflect.PersistentDescriptorFactory.getDescriptor(PersistentDescriptorFactory.java:57)
    at
    org.apache.cayenne.reflect.ClassDescriptorMap.createDescriptor(ClassDescriptorMap.java:129)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.checkDescriptorInitialized(LazyClassDescriptorDecorator.java:51)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.getEntity(LazyClassDescriptorDecorator.java:75)
    at
    org.apache.cayenne.access.trans.SelectTranslator.appendQueryColumns(SelectTranslator.java:267)
    at
    org.apache.cayenne.access.trans.SelectTranslator.buildResultColumns(SelectTranslator.java:240)
    at
    org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:103)
    at
    org.apache.cayenne.dba.postgres.PostgresSelectTranslator.createSqlString(PostgresSelectTranslator.java:32)
    at
    org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:116)
    at
    org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:72)
    at
    org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:58)
    at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
    ... 18 more





    This is my netloader code:

    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.util.Enumeration;
    import java.util.Iterator;
    import java.util.ResourceBundle;
    import java.util.TreeMap;

    public final class NetLoader {

    final static private ResourceBundle RB;
    static {
    RB = ResourceBundle.getBundle(
    //"loader-2_0_4"
    "loader-3_M4"
    );
    }

    private URL[] libUrls;

    public NetLoader() {
    this.initLibrary();
    }

    private void initLibrary() {
    TreeMap libs = new TreeMap();
    Enumeration en = RB.getKeys();
    while (en.hasMoreElements()) {
    String key = en.nextElement();
    libs.put(key,RB.getString(key).split(","));
    }
    libUrls = new URL[libs.size()];
    Iterator it = libs.keySet().iterator();
    int idx = 0;
    while (it.hasNext()) {
    String key = it.next();
    URL url = null;
    try {
    url = new URL(libs.get(key)[0],libs.get(key)[1],libs.get(key)[2]);
    } catch (MalformedURLException e) {
    System.err.println(e.getMessage());
    System.exit(1);
    }
    libUrls[idx++] = url;
    int port = (url.getPort()==-1) ? 80 : url.getPort() ;
    System.out.println("Loading lib: " +
    url.getProtocol()+"://"+url.getHost()+":"+port+url.getFile());
    }

    }

    protected void start() {
    URLClassLoader urlClassLoader = new URLClassLoader(libUrls,
    Thread.currentThread().getContextClassLoader()
    //ClassLoader.getSystemClassLoader()
    );


    try {
    Class<?> clzz =
    Class.forName("it.wipidea.w3d.SomeClass",true,urlClassLoader);
    //Class<?> clzz = urlClassLoader.loadClass("it.wipidea.w3d.SomeClass");
    Method m = clzz.getDeclaredMethod("init", new Class[]{});
    m.invoke(null, new Object[]{});
    } catch (Throwable e) {
    e.printStackTrace();
    }
    }

    /**
    * @param args
    */
    public static void main(String[] args) {
    NetLoader netLoader = new NetLoader();
    netLoader.start();
    }

    }



    And this is the property file used to load all libs:

    ## Cayenne III
    #libs.001 = http,localhost,/users/antares/libs/postgresql-8.2-504.jdbc4.jar
    libs.011 = http,localhost,/users/antares/libs/ashwood-2.0.jar
    libs.012 = http,localhost,/users/antares/libs/asm-3.0.jar
    libs.013 = http,localhost,/users/antares/libs/asm-commons-3.0.jar

    libs.014 = http,localhost,/users/antares/libs/commons-collections-3.1.jar
    libs.015 = http,localhost,/users/antares/libs/commons-logging-1.1.jar
    libs.016 = http,localhost,/users/antares/libs/geronimo-jpa_3.0_spec-1.0.jar
    libs.017 = http,localhost,/users/antares/libs/velocity-1.3.jar

    libs.021 = http,localhost,/users/antares/libs/cayenne-agent-3.0M4.jar
    libs.022 = http,localhost,/users/antares/libs/cayenne-client-3.0M4.jar
    libs.023 = http,localhost,/users/antares/libs/cayenne-modeler-3.0M4.jar
    libs.024 = http,localhost,/users/antares/libs/cayenne-server-3.0M4.jar


    libs.031 = http,localhost,/users/antares/libs/w3d-base.jar
    libs.032 = http,localhost,/users/antares/libs/w3d-orm.jar

    ## Cayenne II
    #libs.001 = http,localhost,/users/antares/libs/postgresql-8.2-504.jdbc4.jar
    #libs.011 = http,localhost,/users/antares/libs/cayenne-2_0_4-util.jar
    #libs.021 = http,localhost,/users/antares/libs/w3d-base.jar
    #libs.022 = http,localhost,/users/antares/libs/w3d-orm.jar


    Currently I am not able to pass all Maven test to build Cayenne,
    so I don't know if the "Class.forName(className)" allows the Util.class
    to solve all classes in the URLLoaderClasspath.

    Hoping can be useful, sorry for long long post :wistle: :-P.


    Best Regards.


    Andrus Adamchik wrote:
    Hi, could you possibly try it with Cayenne 3.0M4? I think it should
    already be fixed there.

    Cheers,
    Andrus

    --
    View this message in context:
    http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20655214.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
    --
    View this message in context: http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20668667.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Scott Anderson at Nov 24, 2008 at 8:20 pm
    Incidentally, you can load the JDBC driver at runtime; you don't have to
    have it on the CP. You'll have to wrap it with a shim loaded by the
    system CL, though, because DriverManager will choke on the non-system
    CL, for whatever reason. http://www.kfu.com/~nsayer/Java/dyn-jdbc.html

    Toss the shim'd driver in to the DriverManager, and pass null to Cayenne
    for the driver (which tells it to ask DriverManager for a driver), and
    you should be good to go. You can see an example of my DataSourceFactory
    here:
    http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/db/conf/Cay
    enneConfiguration.java

    -----Original Message-----
    From: rigel
    Sent: Monday, November 24, 2008 3:05 PM
    To: user@cayenne.apache.org
    Subject: Re: Loading cayenne mapped class from URLClassLoader


    Hi Andrus, first of all thank you for your great work :clap: .


    Andrus Adamchik wrote:
    Hi, could you possibly try it with Cayenne 3.0M4? I think it should
    already be fixed there.
    Yes of course, I try to put my small contribute for what I can.

    This is the output (JDBC driver is the only jar pre-loaded into
    classpath
    because differently by Cayenne 2 now (DriverDataSource.java:62) does not
    solve the
    class driver):

    Loading lib: http://localhost:80/users/antares/libs/ashwood-2.0.jar
    Loading lib: http://localhost:80/users/antares/libs/asm-3.0.jar
    Loading lib: http://localhost:80/users/antares/libs/asm-commons-3.0.jar
    Loading lib:
    http://localhost:80/users/antares/libs/commons-collections-3.1.jar
    Loading lib:
    http://localhost:80/users/antares/libs/commons-logging-1.1.jar
    Loading lib:
    http://localhost:80/users/antares/libs/geronimo-jpa_3.0_spec-1.0.jar
    Loading lib: http://localhost:80/users/antares/libs/velocity-1.3.jar
    Loading lib:
    http://localhost:80/users/antares/libs/cayenne-agent-3.0M4.jar
    Loading lib:
    http://localhost:80/users/antares/libs/cayenne-client-3.0M4.jar
    Loading lib:
    http://localhost:80/users/antares/libs/cayenne-modeler-3.0M4.jar
    Loading lib:
    http://localhost:80/users/antares/libs/cayenne-server-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/w3d-base.jar
    Loading lib: http://localhost:80/users/antares/libs/w3d-orm.jar
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    startedLoading
    INFO: started configuration loading.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataDomain
    INFO: loaded domain: dbw3d
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    loadDataMap
    INFO: loaded .
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: loading .
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
    24-nov-2008 20.20.13 org.apache.cayenne.conf.DriverDataSourceFactory
    load
    INFO: loading driver information from 'dbw3dNode.driver.xml'.
    24-nov-2008 20.20.13
    org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler init
    INFO: loading driver org.postgresql.Driver
    24-nov-2008 20.20.13
    org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler init
    INFO: loading user name and password.
    java.lang.ClassNotFoundException:
    org.apache.cayenne.conf.PlainTextPasswordEncoder
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    org.apache.cayenne.conn.DataSourceInfo.getPasswordEncoder(DataSourceInfo
    .java:207)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler.init(Driver
    DataSourceFactory.java:324)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler.startEleme
    nt(DriverDataSourceFactory.java:191)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElemen
    t(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emp
    tyElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanSta
    rtElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
    ragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unkn
    own
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Un
    known
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
    canDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
    own
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
    own
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unkno
    wn
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.pars
    e(Unknown
    Source)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.load(DriverDataSourceFac
    tory.java:130)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverData
    SourceFactory.java:78)
    at
    org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLo
    adDelegate.java:299)
    at
    org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:
    337)
    at
    org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLo
    ader.java:223)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElemen
    t(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanSta
    rtElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
    ragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unkn
    own
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Un
    known
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
    canDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
    own
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
    own
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unkno
    wn
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.pars
    e(Unknown
    Source)
    at
    org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:79)
    at
    org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfigura
    tion.java:164)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Conf
    iguration.java:157)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Conf
    iguration.java:139)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Conf
    iguration.java:119)
    at
    org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configurati
    on.java:89)
    at
    org.apache.cayenne.access.DataContext.createDataContext(DataContext.java
    :162)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:65)
    at NetLoader.main(NetLoader.java:76)
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger
    logPoolCreated
    INFO: Created connection pool: jdbc:postgresql://localhost/w3d
    Driver class: org.postgresql.Driver
    Min. connections in the pool: 1
    Max. connections in the pool: 1
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: loaded datasource.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    initAdapter
    INFO: no adapter set, using automatic adapter.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLinkDataMap
    INFO: loaded map-ref: dbw3dMap.
    24-nov-2008 20.20.13 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 142 ms.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logQueryStart
    INFO: --- will run 1 query.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection: jdbc:postgresql://localhost/w3d
    Login: postgres
    Password: *******
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger
    logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.postgres.PostgresAdapter
    24-nov-2008 20.20.13 org.apache.cayenne.access.QueryLogger logQueryError
    INFO: *** error.
    java.lang.ClassNotFoundException: it.weev.orm.cayenne.dbw3d.matlibs
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.cayenne.util.Util.getJavaClass(Util.java:589)
    at
    org.apache.cayenne.map.ObjEntity.getJavaClass(ObjEntity.java:271)
    at
    org.apache.cayenne.reflect.PersistentDescriptorFactory.getDescriptor(Per
    sistentDescriptorFactory.java:57)
    at
    org.apache.cayenne.reflect.ClassDescriptorMap.createDescriptor(ClassDesc
    riptorMap.java:129)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.checkDescriptorI
    nitialized(LazyClassDescriptorDecorator.java:51)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.getEntity(LazyCl
    assDescriptorDecorator.java:75)
    at
    org.apache.cayenne.access.trans.SelectTranslator.appendQueryColumns(Sele
    ctTranslator.java:267)
    at
    org.apache.cayenne.access.trans.SelectTranslator.buildResultColumns(Sele
    ctTranslator.java:240)
    at
    org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectT
    ranslator.java:103)
    at
    org.apache.cayenne.dba.postgres.PostgresSelectTranslator.createSqlString
    (PostgresSelectTranslator.java:32)
    at
    org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAsse
    mbler.java:116)
    at
    org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.j
    ava:72)
    at
    org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryActi
    on.java:58)
    at
    org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQuery
    Action.java:424)
    at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQue
    ryAction.java:68)
    at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQu
    eryAction.java:397)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:84
    7)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(Da
    taDomainQueryAction.java:394)
    at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryA
    ction.java:120)
    at
    org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQ
    ueryAction.java:317)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQu
    eryAction.java:96)
    at
    org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
    at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325
    )
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:65)
    at NetLoader.main(NetLoader.java:76)
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:65)
    at NetLoader.main(NetLoader.java:76)
    Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0M4 May 18
    2008
    15:29:33] Query exception.
    at
    org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataD
    omainQueryAction.java:551)
    at
    org.apache.cayenne.access.DataNode.performQueries(DataNode.java:237)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQuery
    Action.java:424)
    at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQue
    ryAction.java:68)
    at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQu
    eryAction.java:397)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:84
    7)
    at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(Da
    taDomainQueryAction.java:394)
    at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryA
    ction.java:120)
    at
    org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQ
    ueryAction.java:317)
    at
    org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQu
    eryAction.java:96)
    at
    org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
    at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325
    )
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:45)
    ... 6 more
    Caused by: java.lang.ClassNotFoundException:
    it.weev.orm.cayenne.dbw3d.matlibs
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.cayenne.util.Util.getJavaClass(Util.java:589)
    at
    org.apache.cayenne.map.ObjEntity.getJavaClass(ObjEntity.java:271)
    at
    org.apache.cayenne.reflect.PersistentDescriptorFactory.getDescriptor(Per
    sistentDescriptorFactory.java:57)
    at
    org.apache.cayenne.reflect.ClassDescriptorMap.createDescriptor(ClassDesc
    riptorMap.java:129)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.checkDescriptorI
    nitialized(LazyClassDescriptorDecorator.java:51)
    at
    org.apache.cayenne.reflect.LazyClassDescriptorDecorator.getEntity(LazyCl
    assDescriptorDecorator.java:75)
    at
    org.apache.cayenne.access.trans.SelectTranslator.appendQueryColumns(Sele
    ctTranslator.java:267)
    at
    org.apache.cayenne.access.trans.SelectTranslator.buildResultColumns(Sele
    ctTranslator.java:240)
    at
    org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectT
    ranslator.java:103)
    at
    org.apache.cayenne.dba.postgres.PostgresSelectTranslator.createSqlString
    (PostgresSelectTranslator.java:32)
    at
    org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAsse
    mbler.java:116)
    at
    org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.j
    ava:72)
    at
    org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryActi
    on.java:58)
    at
    org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
    ... 18 more





    This is my netloader code:

    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.util.Enumeration;
    import java.util.Iterator;
    import java.util.ResourceBundle;
    import java.util.TreeMap;

    public final class NetLoader {

    final static private ResourceBundle RB;
    static {
    RB = ResourceBundle.getBundle(
    //"loader-2_0_4"
    "loader-3_M4"
    );
    }

    private URL[] libUrls;

    public NetLoader() {
    this.initLibrary();
    }

    private void initLibrary() {
    TreeMap libs = new TreeMap();
    Enumeration en = RB.getKeys();
    while (en.hasMoreElements()) {
    String key = en.nextElement();
    libs.put(key,RB.getString(key).split(","));
    }
    libUrls = new URL[libs.size()];
    Iterator it = libs.keySet().iterator();
    int idx = 0;
    while (it.hasNext()) {
    String key = it.next();
    URL url = null;
    try {
    url = new
    URL(libs.get(key)[0],libs.get(key)[1],libs.get(key)[2]);
    } catch (MalformedURLException e) {
    System.err.println(e.getMessage());
    System.exit(1);
    }
    libUrls[idx++] = url;
    int port = (url.getPort()==-1) ? 80 :
    url.getPort() ;
    System.out.println("Loading lib: " +
    url.getProtocol()+"://"+url.getHost()+":"+port+url.getFile());
    }

    }

    protected void start() {
    URLClassLoader urlClassLoader = new
    URLClassLoader(libUrls,

    Thread.currentThread().getContextClassLoader()
    //ClassLoader.getSystemClassLoader()
    );


    try {
    Class<?> clzz =
    Class.forName("it.wipidea.w3d.SomeClass",true,urlClassLoader);
    //Class<?> clzz =
    urlClassLoader.loadClass("it.wipidea.w3d.SomeClass");
    Method m = clzz.getDeclaredMethod("init", new
    Class[]{});
    m.invoke(null, new Object[]{});
    } catch (Throwable e) {
    e.printStackTrace();
    }
    }

    /**
    * @param args
    */
    public static void main(String[] args) {
    NetLoader netLoader = new NetLoader();
    netLoader.start();
    }

    }



    And this is the property file used to load all libs:

    ## Cayenne III
    #libs.001 =
    http,localhost,/users/antares/libs/postgresql-8.2-504.jdbc4.jar
    libs.011 = http,localhost,/users/antares/libs/ashwood-2.0.jar
    libs.012 = http,localhost,/users/antares/libs/asm-3.0.jar
    libs.013 = http,localhost,/users/antares/libs/asm-commons-3.0.jar

    libs.014 =
    http,localhost,/users/antares/libs/commons-collections-3.1.jar
    libs.015 = http,localhost,/users/antares/libs/commons-logging-1.1.jar
    libs.016 =
    http,localhost,/users/antares/libs/geronimo-jpa_3.0_spec-1.0.jar
    libs.017 = http,localhost,/users/antares/libs/velocity-1.3.jar

    libs.021 = http,localhost,/users/antares/libs/cayenne-agent-3.0M4.jar
    libs.022 = http,localhost,/users/antares/libs/cayenne-client-3.0M4.jar
    libs.023 = http,localhost,/users/antares/libs/cayenne-modeler-3.0M4.jar
    libs.024 = http,localhost,/users/antares/libs/cayenne-server-3.0M4.jar


    libs.031 = http,localhost,/users/antares/libs/w3d-base.jar
    libs.032 = http,localhost,/users/antares/libs/w3d-orm.jar

    ## Cayenne II
    #libs.001 =
    http,localhost,/users/antares/libs/postgresql-8.2-504.jdbc4.jar
    #libs.011 = http,localhost,/users/antares/libs/cayenne-2_0_4-util.jar
    #libs.021 = http,localhost,/users/antares/libs/w3d-base.jar
    #libs.022 = http,localhost,/users/antares/libs/w3d-orm.jar


    Currently I am not able to pass all Maven test to build Cayenne,
    so I don't know if the "Class.forName(className)" allows the Util.class
    to solve all classes in the URLLoaderClasspath.

    Hoping can be useful, sorry for long long post :wistle: :-P.


    Best Regards.


    Andrus Adamchik wrote:
    Hi, could you possibly try it with Cayenne 3.0M4? I think it should
    already be fixed there.

    Cheers,
    Andrus

    --
    View this message in context:
    http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-t
    p20654024p20655214.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
    --
    View this message in context:
    http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-t
    p20654024p20668667.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Rigel at Nov 24, 2008 at 11:47 pm
    Tnx, this approach for driver loading sounds really more comfortable than
    mine of heavily using reflection.




    Scott A wrote:
    Incidentally, you can load the JDBC driver at runtime; you don't have to
    have it on the CP. You'll have to wrap it with a shim loaded by the
    system CL, though, because DriverManager will choke on the non-system
    CL, for whatever reason. http://www.kfu.com/~nsayer/Java/dyn-jdbc.html
    Toss the shim'd driver in to the DriverManager, and pass null to Cayenne
    for the driver (which tells it to ask DriverManager for a driver), and
    you should be good to go. You can see an example of my DataSourceFactory
    here:
    http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/db/conf/Cay
    enneConfiguration.java
    --
    View this message in context: http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20672509.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Michael Gentry at Nov 24, 2008 at 9:29 pm
    From your stack trace:
    INFO: loading user name and password.
    java.lang.ClassNotFoundException:
    org.apache.cayenne.conf.PlainTextPasswordEncoder
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    org.apache.cayenne.conn.DataSourceInfo.getPasswordEncoder(DataSourceInfo.java:207)


    It appears that it can't find the PlainTextPasswordEncoder class,
    which should be present. It is the default encoder. Is this class
    somehow not in your JAR?

    Thanks!

    /dev/mrg
  • Rigel at Nov 24, 2008 at 11:24 pm

    Michael Gentry wrote:

    PlainTextPasswordEncoder ... Is this class somehow not in your JAR?
    No, it's present under the jar named cayenne-server-3.0M4.jar.

    It follows the stacktrace produced when I load the JDBC driver too into the
    URLClassLoader.
    As you can notice the ClassNotFound arise from driverClass =
    Class.forName(driverClassName,
    true,Thread.currentThread().getContextClassLoader()); into
    "DriverDataSource.java:62".

    Also PlainTextPasswordEncoder use the same call to retrieve its
    ClassLoader, but just yesterday I noticed that URLClassLoader inherit from
    ClassLoader and not vice versa, probably for security reason. For this
    reason when I call "ClassLoader.getSystemClassLoader()" or
    "Thread.currentThread().getContextClassLoader()" I get only the clean
    classpath at startup, as direct consequence every JAR appears isolated from
    others when using standard ClassLoader invokation.

    So when using URLClassLoader the only way I found to turn around this
    problem is to put a call of Class.forName(className) without specifying any
    ClassLoader directly into the first catch of the main try for
    Class.forName(String,boolean,ClassLoader) call. As note with Cayenne 2 this
    supplementary call into the catch works well without any interference.

    JDBC driver loaded via URLClassLoader

    Loading lib:
    http://localhost:80/users/antares/libs/postgresql-8.2-504.jdbc4.jar
    Loading lib: http://localhost:80/users/antares/libs/ashwood-2.0.jar
    Loading lib: http://localhost:80/users/antares/libs/asm-3.0.jar
    Loading lib: http://localhost:80/users/antares/libs/asm-commons-3.0.jar
    Loading lib:
    http://localhost:80/users/antares/libs/commons-collections-3.1.jar
    Loading lib: http://localhost:80/users/antares/libs/commons-logging-1.1.jar
    Loading lib:
    http://localhost:80/users/antares/libs/geronimo-jpa_3.0_spec-1.0.jar
    Loading lib: http://localhost:80/users/antares/libs/velocity-1.3.jar
    Loading lib: http://localhost:80/users/antares/libs/cayenne-agent-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/cayenne-client-3.0M4.jar
    Loading lib:
    http://localhost:80/users/antares/libs/cayenne-modeler-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/cayenne-server-3.0M4.jar
    Loading lib: http://localhost:80/users/antares/libs/w3d-base.jar
    Loading lib: http://localhost:80/users/antares/libs/w3d-orm.jar
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate
    startedLoading
    INFO: started configuration loading.
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataDomain
    INFO: loaded domain: dbw3d
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate loadDataMap
    INFO: loaded .
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: loading .
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
    24-nov-2008 23.48.02 org.apache.cayenne.conf.DriverDataSourceFactory load
    INFO: loading driver information from 'dbw3dNode.driver.xml'.
    24-nov-2008 23.48.02
    org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler init
    INFO: loading driver org.postgresql.Driver
    24-nov-2008 23.48.02
    org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler init
    INFO: loading user name and password.
    java.lang.ClassNotFoundException:
    org.apache.cayenne.conf.PlainTextPasswordEncoder
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    org.apache.cayenne.conn.DataSourceInfo.getPasswordEncoder(DataSourceInfo.java:207)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler.init(DriverDataSourceFactory.java:324)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler.startElement(DriverDataSourceFactory.java:191)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.load(DriverDataSourceFactory.java:130)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverDataSourceFactory.java:78)
    at
    org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLoadDelegate.java:299)
    at
    org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:337)
    at
    org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLoader.java:223)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:79)
    at
    org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:164)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:157)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:139)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:119)
    at
    org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:89)
    at
    org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:162)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:63)
    at NetLoader.main(NetLoader.java:74)
    24-nov-2008 23.48.02 org.apache.cayenne.access.QueryLogger logPoolCreated
    INFO: Created connection pool: jdbc:postgresql://localhost/w3d
    Driver class: org.postgresql.Driver
    Min. connections in the pool: 1
    Max. connections in the pool: 1
    24-nov-2008 23.48.02 org.apache.cayenne.access.QueryLogger logConnectFailure
    INFO: *** Connecting: FAILURE.
    java.sql.SQLException: Can not load JDBC driver named
    'org.postgresql.Driver': org.postgresql.Driver
    at
    org.apache.cayenne.conn.DriverDataSource.loadDriver(DriverDataSource.java:62)
    at
    org.apache.cayenne.conn.DriverDataSource.setDriverClassName(DriverDataSource.java:256)
    at org.apache.cayenne.conn.DriverDataSource.(DriverDataSource.java:101)
    at org.apache.cayenne.conn.DriverDataSource.(DriverDataSource.java:87)
    at org.apache.cayenne.conn.PoolManager.(PoolManager.java:106)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverDataSourceFactory.java:83)
    at
    org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLoadDelegate.java:299)
    at
    org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:337)
    at
    org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLoader.java:223)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:79)
    at
    org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:164)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:157)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:139)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:119)
    at
    org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:89)
    at
    org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:162)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:63)
    at NetLoader.main(NetLoader.java:74)
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLoadDataNode
    INFO: Error: DataSource load failed
    java.sql.SQLException: Can not load JDBC driver named
    'org.postgresql.Driver': org.postgresql.Driver
    at
    org.apache.cayenne.conn.DriverDataSource.loadDriver(DriverDataSource.java:62)
    at
    org.apache.cayenne.conn.DriverDataSource.setDriverClassName(DriverDataSource.java:256)
    at org.apache.cayenne.conn.DriverDataSource.(DriverDataSource.java:101)
    at org.apache.cayenne.conn.DriverDataSource.(DriverDataSource.java:87)
    at org.apache.cayenne.conn.PoolManager.(PoolManager.java:106)
    at
    org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverDataSourceFactory.java:83)
    at
    org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLoadDelegate.java:299)
    at
    org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:337)
    at
    org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLoader.java:223)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
    Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:79)
    at
    org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:164)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:157)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:139)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:119)
    at
    org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:89)
    at
    org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:162)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:63)
    at NetLoader.main(NetLoader.java:74)
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate initAdapter
    INFO: no adapter set, using automatic adapter.
    24-nov-2008 23.48.02 org.apache.cayenne.conf.RuntimeLoadDelegate
    shouldLinkDataMap
    INFO: loaded map-ref: dbw3dMap.
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at NetLoader.start(NetLoader.java:63)
    at NetLoader.main(NetLoader.java:74)
    Caused by: org.apache.cayenne.ConfigurationException: [v.3.0M4 May 18 2008
    15:29:33] Error during Configuration initialization. [v.3.0M4 May 18 2008
    15:29:33] Load failures. Main configuration class:
    org.apache.cayenne.conf.DefaultConfiguration, details:
    domain.node.name=dbw3dNode, domain.node.datasource=dbw3dNode.driver.xml,
    reason: DataSource load failed - Can not load JDBC driver named
    'org.postgresql.Driver': org.postgresql.Driver
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:166)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:139)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:119)
    at
    org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:89)
    at
    org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:162)
    at it.wipidea.w3d.SomeClass.init(SomeClass.java:42)
    ... 6 more
    Caused by: org.apache.cayenne.ConfigurationException: [v.3.0M4 May 18 2008
    15:29:33] Load failures. Main configuration class:
    org.apache.cayenne.conf.DefaultConfiguration, details:
    domain.node.name=dbw3dNode, domain.node.datasource=dbw3dNode.driver.xml,
    reason: DataSource load failed - Can not load JDBC driver named
    'org.postgresql.Driver': org.postgresql.Driver
    at
    org.apache.cayenne.conf.RuntimeLoadDelegate.finishedLoading(RuntimeLoadDelegate.java:454)
    at org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:80)
    at
    org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:164)
    at
    org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:157)
    ... 11 more





    Michael Gentry wrote:
    From your stack trace:

    INFO: loading user name and password.
    java.lang.ClassNotFoundException:
    org.apache.cayenne.conf.PlainTextPasswordEncoder
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    org.apache.cayenne.conn.DataSourceInfo.getPasswordEncoder(DataSourceInfo.java:207)


    It appears that it can't find the PlainTextPasswordEncoder class,
    which should be present. It is the default encoder. Is this class
    somehow not in your JAR?

    Thanks!

    /dev/mrg
    --
    View this message in context: http://www.nabble.com/Loading-cayenne-mapped-class-from-URLClassLoader-tp20654024p20672220.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 24, '08 at 2:48a
activeNov 24, '08 at 11:47p
posts8
users4
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase