jndi

problem configure JBoss to work with JNDI

I am trying to bind connection to the DB using JNDI in my application that runs on JBoss. I did the following: I created the datasource file oracle-ds.xml filled it with the relevant xml elements: <datasources> <local-tx-datasource> <jndi-name>bilby</jndi-name> ... </local-tx-datasource> </datasources> and put it...

How to use JNDI to obtain a new Stateful Session Bean, in EJB3?

I'm trying to use JNDI to obtain a new Stateful Session Bean in a servlet (as a local variable). My doGet() method has the following: Bean bean = (Bean) new InitialContext().lookup("beanName"); I've tried including java:comp/env but all of my attempts have led to naming exceptions. I'm attempting to bind the bean in the @Stateful an...

problem configure JBoss to work with JNDI(2)

in continuation to the question from last week: http://stackoverflow.com/questions/2828237/problem-configure-jboss-to-work-with-jndi I'm trying to bind datasource in JBoss and use it in my application. In my struggling, I already managed to avoid the javax.naming.NameNotFoundException by: 1. using in java new InitialContext().lookup(co...

problem-configure-jboss-to-work-with-jndi(3)

Sorry for opening new thread every time for the same problem. It's just that I'd like to refine my question during my investigation and it's hard to do it in stackoverflow structure on the same question (maybe on purpose). Anyway, in continuation to this thread http://stackoverflow.com/questions/2843218/problem-configure-jboss-to-work-w...

Configure JBOss cache to run on JBoss server 4.2.3.GA

Our commercial application used to run on different application server and letely we started adjust it to run on JBoss server. The problem is that that application runs JBoss cache and as part of the integration with this framework, the web-inf\lib contains the follwing jars: jboss-aop.jar, jbosscache-core.jar, jboss-common.jar, jboss-c...

Good learning resources for JNDI implementation (JBoss 5)

I have been working with JavaEE/EJB3 web apps for about half a year now. Until recently, I haven't had to touch a lot of the behind-the-scenes stuff, just the meat of the code. I have been wrestling with JNDI problems, and though I've solved a couple of them, I'm pretty much just doing the whole cargo cult copy-paste routine. It would re...

resource-ref at application scope in EJB 2.1 Project

Is it possible to define resource references that are applicable to all EJBs in an application? Currently I have an ejb-jar.xml that looks something like this: <ejb-jar> <enterprise-beans> <session id="foo"> <!-- snip --> <resource-ref> <res-ref-name>jdbc/myDatasource</res-ref-name> <res-type>javax.sql...

Remote interface lookup-problem in Glassfish3

I have deployed a war-file, with actionclasses and a facade, and a jar-file with ejb-components (a stateless bean, a couple of entities and a persistence.xml) on glassfish3. My problem is that i cant find my remote interface to the stateless bean from my facade. My bean and interface looks like: @Remote public interface RecordService {...

How to JNDI lookup from cluster 1 : a queue that exists in cluster 2 in Websphere 6?

I have a Websphere topology wherein in Cluster1, I have an MDB that's trying to publish to another MDB that resides in Cluster2. Since they're both in the same container, I tried simply Blockquote Context ctx = new InitialContext(); ctx.lookup("jms/MyQueue"); Blockquote The "jms/MyQueue" is configured in Cluster2. As you can...

Tomcat 6 Realm Config with Windows AD

We have Tomcat 6 connecting to a Win2k3 Server running AD. The realm is configured as such <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99" referrals="follow" connectionURL="<url>" connectionName="CN=Query Account,OU=Service Accounts,DC=company,DC=com" connectionPassword="<pwd>" userBase="OU=Users,DC=com...

Spring JndiTemplate and parameterized JNDI lookup from context

How can I represent new JndiTemplate(properties).lookup(name), where name is a string variable, in the Spring application context file? Can I express it in a way similar to the following, where the application provides name when it retrieves the bean ID? <util:properties id="applicationProperties" location="classpath:application.pr...

How do I inject @WebServiceRef resources through Glassfish JNDI?

My web application is a consumer of some internal web services provided by the organisation. I have seen a couple of examples where a web service reference is injected using something like: @WebServiceRef(name="services/MyService") MyService myService; But I have no idea how to define the services/MyService JNDI object in Glassfish v...

jndi.properties in JBoss

Is there any way to configure JNDI so the lookup first checks localhost and if it doesn't find matching name it performs automatic discovery of other jndi servers? ...

JNDI - how it works

If I understand correctly the default JNDI service runs on my local AS, right? So if I create an EJB and in jboss.xml (running JBoss) I name it "sth" than it is registered in my AS. Correct? In big projects EJBs might be distributed through many servers - on one server EJBs doing sth and on another sth else. When calling JNDI loopup() I...

What does Glassfish use as backing store to JNDI when clustered?

I have a JBoss background, where JNDI in clusters is provided by a centralized fail-over service, HA-JNDI. With this configuration you get one JNDI namespace across the cluster (i.e I can look up a service on node B from node A). When i look at the glassfish architecture, I cannot deduce how (and if) JDNI is synchronized between server i...

How to obtain JNDI data source for JPA/JTA DAO integration test?

I have a JPA application that has specified JTA transactions in persistence.xml. For whatever reason, I have found that when using JTA, you MUST specify a JNDI data source within persistence.xml as well. This is fine, unless you are trying to go integration testing outside a container and JNDI is not available. My questions are: a) i...

How to deploy a Configuration to the JNDI tree of the Glass fish server

I want to deploy a HashMap of configuration to the JNDI tree of Glass Fish server. I am migrating a framework from Weblogic to GLassfish. Previously it was done via the following code.. Where the Environment is *weblogic.jndi.Environment;* public void deployConfiguration(HashMap configuration) throws GenericFrameworkException { ...

How can I spoof a jndi lookup for a datasource without a app server

I want to test some new functionality which is part of an internal web app. This new code uses a database connection normally provided by an app server (tomcat). I do not want to recreate the entire web app on my local machine to test the new code, since I only need to run one function. Does anyone know how I can 'spoof' a Context, or ...

Finding JNP port in JBoss from Servlet

I have a servlet running in JBoss (4.2.2.GA and 4.3-eap) that needs to connect to an EJB to do work. In general this code works fine to get the Context to connect and make RMI calls (all in the same server). public class ContextFactory { public static final int DEFAULT_JNDI_PORT = 1099; public static final String DEFAULT_CONTEXT_FA...

JNDI name not bound

Hi. I'm going crazy trying to fix this exception: javax.naming.NameNotFoundException: lawless not bound This is a Stripes web app built in Intellij and being deployed on Jboss 4.2.3 (Using 4.2.3 because Stripes has issues with later versions. I have successfully used 4.2.3 in the past so I know that's not the problem). I have one ses...