[Beginners Corner] - Re: javax.naming.NameNotFoundException: jdbc not bound
by PeterJ
I'm sorry, I didn't look carefully enough at the config files presented in the wiki entry that I referred you to, and did not realize that the information was not relevant for a web app. Here is an example (usually the basic datasource name is the same in all the files, but I used different names so that you can see which names need to be the same):
*-ds.xml excerpt:
<jndi-name>jdbc/SomeDS</jndi-name>
web.xml excerpt:
<resource-ref>
| <res-ref-name>jdbc/TheDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| <res-sharing-scope>Shareable</res-sharing-scope>
| </resource-ref>
jboss-web.xml:
<jboss-web>
| <resource-ref>
| <res-ref-name>jdbc/TheDS</res-ref-name>
| <jndi-name>java:jdbc/SomeDS</jndi-name>
| </resource-ref>
| </jboss-web>
|
datasource lookup in servlet:
InitialContext ctx = new InitialContext();
| DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TheDS");
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232520#4232520
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232520
16 years, 11 months
[EJB 3.0] - Re: MDB external configuration
by jaikiran
anonymous wrote : I'm hesitant to require that the person installing my consumer application(s) unzip the ear, change the selector's "myClientID" value, and rezip it. I would rather use a identical application package on our multiple production servers (and the test servers for that matter) and have other files, descriptors, or database settings outside of the ear tweaked to account for the environment.
I don't exactly remember which deployment descriptor file will contain the message selector - its either the ejb-jar.xml or the jboss.xml. In either case i guess you could specify some system property that gets substituted per system, dynamically. Something like this in the deployment descriptor:
<message-selector>${someproperty}</message-selector>
Then, you can pass this property value as a JVM parameter through the server startup scripts:
run.bat -Dsomeproperty=myClientID
You can edit the run.bat or run.conf to pass this property too.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232515#4232515
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232515
16 years, 11 months
[EJB 3.0] - Oracle 10g with Jboss 4.2.3 Entity Manager / Hibernate
by ejb3workshop
My application uses 3 different datasources all going to the same database. One with XA support is used via the JNDI name by the entity manager configured in persistence.xml. The other two are no-tx-datasources.
I am able to access certain aspects using the datasources however as soon as I try to make a change via entity manager I get the error shown below.
Any suggestions on what I am doing wrong. The same application works fine using SQL Server 2005.
anonymous wrote :
| 4:47:40,170 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
| 4:47:40,170 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
| 4:47:40,342 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
| ith the Partitioning, OLAP, Data Mining and Real Application Testing options
| 4:47:40,342 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.2.0.4.0
| 4:47:40,389 INFO [Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect
| 4:47:40,404 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
| 4:47:40,404 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
| 4:47:40,420 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
and then later
anonymous wrote :
| 14:47:48,920 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 14:47:48,951 INFO [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 1m:4s:969ms
| 14:48:03,342 WARN [PageNotFound] No mapping for [/diagnostics/spring/j_security_check] in DispatcherServlet with name 'thunderhead'
| 14:48:35,092 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
| 14:48:35,092 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fdd7:cf6:4a155b48:d1 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fdd7
| :cf6:4a155b48:d1 status: ActionStatus.ABORT_ONLY >)
| 14:48:35,092 INFO [DefaultLoadEventListener] Error performing load command
| org.hibernate.exception.GenericJDBCException: Cannot open connection
| at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
| at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
| at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
| at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
| at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
| at org.hibernate.loader.Loader.doQuery(Loader.java:673)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
| at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
| at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
| at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
| at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
| at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
| at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
| at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
| at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
| at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
| at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232512#4232512
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232512
16 years, 11 months