Hi David,
hi Andrew,
hi there,

after a remote debugging session I’ve found the problem (Remember I will use a 
JNDI JDBC Datasource!):

In ERXMigrator

        protected boolean canMigrateModel(EOModel model) {
                String adaptorName = model.adaptorName();
                if ("Memory".equals(adaptorName)) {
                        return true;
                }
                if ("JDBC".equals(adaptorName)) {
                        String url = 
(String)model.connectionDictionary().objectForKey(JDBCAdaptor.URLKey);
                        if ((url != null && 
url.toLowerCase().startsWith("jdbc:"))) {
                                return true;
                        }
                        String dataSourceJndiName = (String) 
model.connectionDictionary().objectForKey(JDBCAdaptor.DataSourceJndiNameKey);
                        if(dataSourceJndiName != null) {
                                return true;
                        }
                }
                return false;
        }


AdaptorName = JDBC
url = null (JNDI should be used so in my Properties GlobalURL etc. is not  set)
dataSourceJndiName = null !! (why?)

results in 

        protected void _buildDependenciesForModel(EOModel model, int 
migrateToVersion, Map<String, Integer> versions, Map<IERXMigration, 
ERXModelVersion> migrations) throws InstantiationException, 
IllegalAccessException {
                if (!canMigrateModel(model)) {
                        return;
                }
…
…

Migrator: you can’t make a Migration … and thats it …

Datasource is set in web.xml as I said before …

I’ve found this posting 
https://www.mail-archive.com/webobjects-dev@lists.apple.com/msg13087.html 
(Andrew L.)

they said set JDBCAdaptor.DataSourceJndiNameKey in connectionDictionary …

I’ve done so …

index.eomodeled:

{
    EOModelVersion = "2.1"; 
    adaptorName = JDBC; 
    connectionDictionary = {
        JDBCAdaptor.DataSourceJndiNameKey = "jdbc/test";
    }; 
    entities = ({className = "xxx.xxx.xxx.KeyValues"; name = KeyValues; }); 
}

Results in 

The connection dictionaries for TestModel and erprototypes have the same URL 
and username, but at least one of them is a prototype model, so it shouldn't be 
a problem.
[28.03.14 CET] 0000005d webapp        E com.ibm.ws.webcontainer.webapp.WebApp 
commonInitializationFinally SRVE0266E: Beim Initialisieren von Servlets ist ein 
Fehler aufgetreten: {0}
                                 javax.servlet.UnavailableException: Error 
initializing servlet adaptor: null
        at 
com.webobjects.jspservlet.WOServletAdaptor._applicationInit(WOServletAdaptor.java:442)
        at 
com.webobjects.jspservlet.WOServletAdaptor.initStatics(WOServletAdaptor.java:95)
        at 
com.webobjects.jspservlet.WOServletAdaptor.init(WOServletAdaptor.java:652)
        at 
er.extensions.jspservlet.ERXServletAdaptor.init(ERXServletAdaptor.java:66)
        at javax.servlet.GenericServlet.init(GenericServlet.java:161)
        at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:342)
        at 
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
        at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1366)
        at 
com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:610)
        at 
com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:580)
        at 
com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:425)
        at 
com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)

How can I set JDBCAdaptor.DataSourceJndiNameKey in my Properties?

Or better how can I fix the JNDI - Migration problem the right way?


Thank you for your help!
Matthias




Am 24.04.2014 um 15:18 schrieb David Avendasora <webobje...@avendasora.com>:

> 
> On Apr 24, 2014, at 9:16 AM, David Avendasora <webobje...@avendasora.com> 
> wrote:
> 
>> Override the migrationsWillRun method and stick a breakpoint on it. Let’s 
>> make sure that it is getting that far.
> 
> Umm… in your subclass of ERXApplication, in case that wasn’t clear… It 
> probably was to you, but hey, Future Dave is going to come here at some 
> point, and *that* guy is pathetic.
> 
> Sir Dave
> 
> —————————————————————————————
> WebObjects - so easy that even Dave Avendasora can do it!™
> —————————————————————————————
> David Avendasora
> Senior Software Abuser
> Nekesto, Inc.
> 
> 
> 
> 
> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to