Jump to content
Changes to the Jaspersoft community edition download ×

JNDI for DB2


clarita.munozgarcia

Recommended Posts

I'm trying to connect via JNDI my JasperStudio writting in the context.xml inside /jasperserverpro-war/META-INF but I don't have any success.

My code is:

<Resource name="jdbc/db2_jasper" auth="Container" type="4"
        maxActive="100" maxIdle="30" maxWait="10000"
        username="SVJASP01" password="P13DR4"
        driverClassName="com.ibm.db2.jcc.DB2Driver"
        validationQuery="select 1"
        testOnBorrow="true"
        factory="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"
        url="jdbc:db2://10.28.110.1:446/LOC1"  />
 
What is wrong? Is possible to do what I want?
 
A exception is shown in my JasperStudio:
 
net.sf.jasperreports.engine.JRException: javax.naming.NameNotFoundException; remaining name 'env/jdbc/db2_jasper'
at net.sf.jasperreports.data.jndi.JndiDataAdapterService.contributeParameters(JndiDataAdapterService.java:88)
at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:129)
at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.run(AbstractDataAdapterWizard.java:163)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: javax.naming.NameNotFoundException; remaining name 'env/jdbc/db2_jasper'
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:500)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:531)
at org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:546)
at org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:112)
at javax.naming.InitialContext.lookup(Unknown Source)
at net.sf.jasperreports.data.jndi.JndiDataAdapterService.contributeParameters(JndiDataAdapterService.java:83)
... 3 more
 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Did you add resource-ref to web.xml? It generally is in following format

 

  <resource-ref>
    <description>XX</description>
    <res-ref-name>jdbc/db2_jasper</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...