We run JBoss as standalone and the datasource are defined in standalone.xml 
file as below. It works fine for years under GWT 2.2.

        <subsystem xmlns="urn:jboss:domain:datasources:1.2">
            <datasources>
                <datasource jndi-name="java:jboss/datasources/oe" 
pool-name="DataSource" enabled="true" use-java-context="true">
                    
<connection-url>jdbc:sqlserver://dbserver/wdsql1_inst:1442;databaseName=Dev</connection-url>
                    <driver>sqljdbc4</driver>
                    <pool>
                        <min-pool-size>2</min-pool-size>
                        <max-pool-size>5</max-pool-size>
                    </pool>
                    <security>
                        <user-name>db</user-name>
                        <password>password</password>
                    </security>
                    <validation>
                        <check-valid-connection-sql>select 
@@VERSION</check-valid-connection-sql>
                    </validation>
                    <statement>
                        
<prepared-statement-cache-size>32</prepared-statement-cache-size>
                        
<share-prepared-statements>true</share-prepared-statements>
                    </statement>
                </datasource>
                <drivers>
                    <driver name="sqljdbc4" module="com.sql.sqljdbc4">
                        
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>


On Sunday, April 16, 2017 at 8:44:37 PM UTC-4, Juan Pablo Gardella wrote:
>
> Gwt 2.8 uses java7. Are you using this version? The jndi name AFAIK is 
> defined in jboss-web.xml file for jboss
>
> El dom., 16 de abr. de 2017 21:26, <simontu...@gmail.com <javascript:>> 
> escribió:
>
>> We used GWT for many years and not upgrade it for far.
>> We want to upgrade it to the latest GWT 2.8 and Java 1.8. We had a lot of 
>> issues.
>>
>> Currently we had problem to create a data source with Spring under JBoss 
>> 6.4. It used to work on under GWT 2.2.
>>
>> The data source is defined in JBoss and it bounds to the database without 
>> issue. It specified JNDI name there.
>>
>> In Spring context we reference the jndi name defined in JBoss data source:
>>
>>     <bean id="dataSource" 
>> class="org.springframework.jndi.JndiObjectFactoryBean">
>>         <property name="jndiName">
>>             <value>java:jboss/datasources/oe</value>
>>         </property>
>>     </bean>
>>
>> This used to work in GWT 2.2 but not in GWT 2.8. It tried to look in the 
>> jetty environment.It failed to find the jndi name.
>> Do I need to specify something special to let it looking for the JBoss 
>> defined jndi name?
>>
>> 23:39:32,746 DEBUG 
>> [org.springframework.beans.factory.support.DefaultListableBeanFactory] 
>> (ServerService Thread Pool -- 53) Invoking afterPropertiesSet() on bean 
>> with name 'dataSource'
>> 23:39:32,746 DEBUG [org.springframework.jndi.JndiTemplate] (ServerService 
>> Thread Pool -- 53) Looking up JNDI object with name 
>> [java:jboss/datasources/oe]
>> 23:39:32,746 DEBUG [jndi] (ServerService Thread Pool -- 53) 
>> InitialContextFactory.getInitialContext()
>> 23:39:32,746 DEBUG [jndi] (ServerService Thread Pool -- 53) Created 
>> initial context delegate for local namespace:
>> org.eclipse.jetty.jndi.local.localContextRoot@7f559695
>> 23:39:32,746 DEBUG [jndi] (ServerService Thread Pool -- 53) Looking up 
>> name="java:jboss/datasources/oe"
>> 23:39:32,777 ERROR [org.springframework.web.context.ContextLoader] 
>> (ServerService Thread Pool -- 53) Context initialization failed: 
>> org.springframework.beans.factory.BeanCreationException: Error creating 
>> bean with name 'departmentCodeDAOImpl': Injection of persistence 
>> dependencies failed; nested exception is 
>> org.springframework.beans.factory.BeanCreationException: Error creating 
>> bean with name 'entityManagerFactory' defined in ServletContext resource 
>> [/WEB-INF/classes/resources/database-context.xml]: Cannot resolve reference 
>> to bean 'dataSource' while setting bean property 'dataSource'; nested 
>> exception is org.springframework.beans.factory.BeanCreationException: Error 
>> creating bean with name 'dataSource' defined in ServletContext resource 
>> [/WEB-INF/classes/resources/database-context.xml]: Invocation of init 
>> method failed; nested exception is javax.naming.NameNotFoundException; 
>> remaining name 'java:jboss/datasources/oe'
>> Related cause: org.springframework.beans.factory.BeanCreationException: 
>> Error creating bean with name 'dataSource' defined in ServletContext 
>> resource [/WEB-INF/classes/resources/database-context.xml]: Invocation of 
>> init method failed; nested exception is javax.naming.NameNotFoundException; 
>> remaining name 'java:jboss/datasources/oe'
>> at 
>> org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:342)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
>>  
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
>>  
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
>>  
>> [org.springframework.web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
>>  
>> [org.springframework.web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
>>  
>> [org.springframework.web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339)
>>  
>> [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
>> at 
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) 
>> [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
>> at 
>> org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163)
>>  
>> [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
>> at 
>> org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61)
>>  
>> [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
>> at 
>> org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96)
>>  
>> [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
>> at 
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
>> [rt.jar:1.8.0_60]
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
>> [rt.jar:1.8.0_60]
>> at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>  
>> [rt.jar:1.8.0_60]
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>  
>> [rt.jar:1.8.0_60]
>> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]
>> at org.jboss.threads.JBossThread.run(JBossThread.java:122)
>> Caused by: org.springframework.beans.factory.BeanCreationException: Error 
>> creating bean with name 'entityManagerFactory' defined in ServletContext 
>> resource [/WEB-INF/classes/resources/database-context.xml]: Cannot resolve 
>> reference to bean 'dataSource' while setting bean property 'dataSource'; 
>> nested exception is 
>> org.springframework.beans.factory.BeanCreationException: Error creating 
>> bean with name 'dataSource' defined in ServletContext resource 
>> [/WEB-INF/classes/resources/database-context.xml]: Invocation of init 
>> method failed; nested exception is javax.naming.NameNotFoundException; 
>> remaining name 'java:jboss/datasources/oe'
>> at 
>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:99)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findNamedEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:511)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:493)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:657)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:630)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:150)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:339)
>>  
>> [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> ... 24 more
>> Caused by: org.springframework.beans.factory.BeanCreationException: Error 
>> creating bean with name 'dataSource' defined in ServletContext resource 
>> [/WEB-INF/classes/resources/database-context.xml]: Invocation of init 
>> method failed; nested exception is javax.naming.NameNotFoundException; 
>> remaining name 'java:jboss/datasources/oe'
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> ... 41 more
>> Caused by: javax.naming.NameNotFoundException; remaining name 
>> 'java:jboss/datasources/oe'
>> at 
>> org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:487)
>>  
>> [gwt-dev.jar:]
>> at 
>> org.eclipse.jetty.jndi.local.localContextRoot.lookup(localContextRoot.java:533)
>>  
>> [gwt-dev.jar:]
>> at javax.naming.InitialContext.lookup(InitialContext.java:417) 
>> [rt.jar:1.8.0_60]
>> at javax.naming.InitialContext.lookup(InitialContext.java:417) 
>> [rt.jar:1.8.0_60]
>> at 
>> org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) 
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) 
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) 
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) 
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
>>  
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
>>  
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
>>  
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
>>  
>> [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
>>  
>> [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
>> ... 48 more
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com <javascript:>.
>> To post to this group, send email to google-we...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to