jndi

DataSource not injected to @Resource annotated field with alwaysUseJndiLookup setting

Hello! I've just read about @Resource annotation from this article (http://www.infoq.com/articles/spring-2.5-part-1) and wish to use it on Tomcat 6.0.26 and Spring 3.0.3 But it does not work -- field ds in Users class does not initialized and I've got NullPointerException when I try to made a query. File src/org/example/db/Users.java ...

Externalizing Spring Security configuration?

I have a web application that works with several different configurations of Spring Security already. However, these difference configuration are all setup within my applicationContext configuration file. Therefore, in order to tweak these at a customer site, these would have to be modified INSIDE the WAR file. If customers manually m...

LDAP JNDI Authentication fail??

Hi there, I'm attempting to build a JavaFX for browser use that will handle an authentication prompt against a LDAP Server. When launching JavaFX as a desktop application, I am able to authenticate against the LDAP server using JNDI. However, when I launch JavaFX on the browser, I will get the following error: javax.naming.Communicat...

Mbeans with JBoss

Hi, I'm trying to call a MBean deployed in JBoss, but i'm having this exception: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.io.InvalidClassException: org.jboss.security.auth.callback.SecurityAssociationHandler; org.jboss.security.auth.callback.SecurityAssociationHandler; class invalid for...

Best way to manage DB connections without JNDI

I have a website, in which currently I am getting 1000 page views. I am expecting it will go around 30k per day in future. Now the problem for me to manage the DB connections. At present I am just connecting to DB directly from java program. I know it is worst design in the world. But for time being I have written like that. I have plan ...

Error Getting JDBC Connection

Hi there, im having problem getting a JDBC connection from a EJB SessionBean.The error which is being throwing is: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous war...

creating userPattern for JNDIRealm

Hey guys, I have to meet a second distinguishion among users. I just pasted out the example given for JNDIRealm dn: uid=jjones,ou=people,dc=mycompany,dc=com <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99" connectionName="cn=Manager,dc=mycompany,dc=com" connectionPassword="secret" connectionURL="ldap://local...

Java JNDI Delete entire LDAP subtree

Hi all, I need to delete entire LDAP subtree, by Java code, like the -r parameter of ldapdelete command. How can I do that? There is a simple way to delete entire LDAP subtree with JNDI? Thanks and best regards, Roberto. ...

tomcat 6 custom property resource

1) modify $CATALINA_HOME/conf/context.xml with this line <Environment name="testValue" value="hello world" type="java.lang.String" override="true" /> 2) add this in web.xml of new web-app <resource-env-ref> <resource-env-ref-name>testValue</resource-env-ref-name> <resource-env-ref-type>java.lang.String</resource-env-ref-type>...

using JNDI when websphere is shutdown

I am trying to test my we based project.I have created main method and its call some db related classes.Now the db related classes uses JNDI , so when running the code i get exception Can i use JNDI when websphere server is stopped?If now how can i go about it?i dont want to run entire flow, i want to test my functionality by calling cl...

javax.naming.NameNotFoundException

Hi I am running an example of ejb using JBoss5 Container. I am using an example from here(Part one). In the example I deployed bean in JBoss and an application in Tomcat(to acces the bean from JBoss). I am getting the error in the screen of tomcat server javax.naming.NameNotFoundException: greetJndi not bound ( greetJndi is the jndi-...

Accessing JNDI from within Eclipse OSGI bundle, hosted in WebSphere App Server

Hi, I have a problem accessing JNDI resources from within an OSGI bundle, hosted in WebSphere Application Server (WAS) using a servlet bridge. It is failing on creating the JNDI initial context. My code is: Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory...

how to implement EJB in My senior?

Hi What is happening in my case is that the Bonita studio creates the task in its environment Env1, and that my Java class tries to find the task in its environment Env2. However, both environments are independant. If i need to have 2 different Java process to manipulate the same environment via API, i'll have to export the bonita API ...

Jetty JNDI error within Maven Jetty Plugin

I am trying to configure a JNDI data source that can be used from an invocation of the Maven Jetty Plugin. I am trying to do this external to the WAR file, so that anyone who might later deploy our webapp with Jetty will not have to edit a configuration file inside the WAR's WEB-INF directory. I created a jetty.xml file as follows: <?...

How to set transaction timeout on Jetty JNDI Atomikos configuration

I am in the process of converting various Spring beans to JNDI lookups. Currently I am using Jetty to test this. I have configured the UserTransaction according to the Jetty documentation and it works: <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction"> <Arg> <New class="com.atomikos.icatch.jta.UserTransactionI...

Java EE 6 - Embedded container EJB tests

This questiong is regarding Java EE 6, using glassfish v3 embedded-all. I have a unit test that uses EJBContainer to test my stateless EJB. Problem is I'm having trouble looking up the EJB (remote) using JNDI: setup() { ctx = EJBContainer.createEJBContainer().getContext(); } ... test() { BookService bookService = (BookService)ct...

Securing JNDI for remote clients on JBoss

Does anybody know how to secure the JNDI access for remote clients on JBoss? I know how to secure remote JMX invokers but even with that in effect it is still possile to lookup, bind and unbind things in JNDI even if the client is not authenticated. I would like that that the server refuses to give you access to the InitialContext if yo...

Security Realm for an application within WebSphere 7.0

We are testing using security realms with our web application. In test we will be going against Microsoft Active Directory. Production will go against a custom realm. I have the working great in Tomcat, but can't seem to get this working in WebSphere. I have created a Security Domain (foo-ldap) within WebSphere that can connect to th...

Cannot configure datasource for db2 in tc-server.

I am getting a null pointer exception when trying to set up datasource in spring's tc server. Which is basically a Tomcat at its core. Here is the exception I am getting. org.apache.naming.NamingContext lookup WARNING: Unexpected exception resolving reference java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:394)...

JWS & Secure Database Connections using Glassfish V3

I need to distribute my Swing application using JWS. I use JPA and connect to both Postgres and MSSQL. How do I ensure secure database connections? Can I use JDBC Connection Pooling configured in Glassfish? If so, how do I configure my app to use it? Best Regards. ...