• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations


  • Subject: Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations
  • From: Matthias Jakob <email@hidden>
  • Date: Fri, 25 Apr 2014 01:47:23 +0200

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 = "">
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 = "" (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/email@hidden/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 <email@hidden>:


On Apr 24, 2014, at 9:16 AM, David Avendasora <email@hidden> 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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations
      • From: Matthias Jakob <email@hidden>
References: 
 >JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: Matthias Jakob <email@hidden>)
 >Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: David Avendasora <email@hidden>)
 >Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: Matthias Jakob <email@hidden>)
 >Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: Theodore Petrosky <email@hidden>)
 >Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: Matthias Jakob <email@hidden>)
 >Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: David Avendasora <email@hidden>)
 >Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations (From: David Avendasora <email@hidden>)

  • Prev by Date: Re: [Wonder-disc] SQL Generation Issue
  • Next by Date: Entity Modeler standalone
  • Previous by thread: Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations
  • Next by thread: Re: JNDI JDBC entry in web.xml Servlet Deployment vs. Migrations
  • Index(es):
    • Date
    • Thread