Questions tagged [initial-context]
74 questions
0
votes
2 answers
wildfly-8.1.0.Final Failed instantiate InitialContextFactory
im getting following Error
**ERROR:**
2014-10-07 16:33:46,692 ERROR [stderr] (default task-1) javax.naming.NamingException:
JBAS011843: **Failed instantiate** **InitialContextFactory
org.jboss.naming.remote.client.InitialContextFactory** from…

Shankar S
- 133
- 1
- 5
- 15
0
votes
1 answer
why use properties over hashtable when getting initial context
I wrote a client to get EJB's deployed in JBoss. I referred to examples in internet. Almost all of them use Properties class to define the URL and initial context factory. I want to know why properties is preferred over hashtable as here we are not…

ajith
- 5
- 2
0
votes
1 answer
How to get a static List from a Message Driven Bean?
I am using a Message Driven Bean for storing messages in a list as you can see in the code given below:
/**
*
* @author sana-naeem
*/
@MessageDriven(mappedName = "jms/Queue-0", activationConfig = {
@ActivationConfigProperty(propertyName =…

Developer
- 161
- 2
- 3
- 15
0
votes
0 answers
Exception when I try create JNDI Subcontext from JUnit
My purpose - create test for DAO layer. My Hibernate config has datasourse specified throught JNDI. Also I use Jboss 5.1 so transaction lookup is necessary.
java:jdbc/MysqlDS

Tioma
- 2,120
- 9
- 35
- 52
0
votes
1 answer
JBoss 4.2.3: LDAP Initial Context loading slow
I am using Jboss 4.2.3 and I am trying to connect to LDAP server and calling this piece of code to create the initial context:
Hashtable environment = new Hashtable();
environment.put(Context.PROVIDER_URL,…

Dunxton
- 408
- 1
- 8
- 21
0
votes
1 answer
Cannot Lookup from InitialContext Queue that has same name with another Topic
This line of code produces an exception
Queue queue = (Queue) initialCtx.lookup("sample");
javax.naming.CannotProceedException: Name 'sample' is ambiguous: both a topic and a queue exist
at…

bibobeo
- 1
- 1
0
votes
2 answers
How to get Queue using context.lookup() in oracle 11g
I want to create Queue and the MessageDrivenBean in Oracle 11g.
I created the JMS Module on Weblogic and into it I created Queue and ConnectionFactory.
JDBC names looks like:
Queue: jms/EvZahQueue
ConnectionFactory: jms/ConnectionFactory
I tried to…

Stojan
- 80
- 11
0
votes
1 answer
Close InitialContext
I have a class that uses a method from another EJBHelper class which calls the method getInitialContext to initialize an InitialContext.
Now, the problem is that I need to close the InitialContext after the EJB process ends.
Please help; how can I…
0
votes
1 answer
From EJB 2.0 to EJB 3.0
Here Is the code that I have to create an EJB 2.0
How can I convert this so can be used for EJB 3.0
java.lang.Object ejbHomeStub = initCtx.lookup(ejbJNDIName);
EJBHome ejbHome = (EJBHome)
javax.rmi.PortableRemoteObject.narrow(ejbHomeStub,…

otc
- 694
- 1
- 9
- 40
0
votes
1 answer
InitialContext.lookup() parameter in JBoss 7.1
I am new in the world of EJB 3.1 and trying to get some basics with the JBoss Application Server 7.1.
At the moment I am stuck at a - really basic - problem. When a bean on the server wants to use another bean I need to use the…

FredFloete
- 627
- 2
- 13
- 33
0
votes
1 answer
JNDI InitialContext - Server Path
I am struggling to understand what InitialContext does. I understand that it provides initial context to lookup objects, but which server does it lookup?
I know that we can pass the server url as one of the properties for Context, but "generally"…

Sandeep Jindal
- 14,510
- 18
- 83
- 121
0
votes
1 answer
Initial Context Lookup returns same instance | Inject stateless EJB in Pojo
I am trying to inject a EJB in POJO by using context lookup.
What I am expecting is a stateless behavior of EJB as you get when you do a
@EJB annotation
The EJB has a entityManager which I get from the EntityManagerFactory in the constructor for…

user804979
- 913
- 1
- 6
- 9
-1
votes
1 answer
MQ connection throwing null pointer during context.lookup in tomcat
I am trying to connect to MQ using JNDI lookup defined in context.xml of tomcat. While starting the application, i am getting a NamingException and a NullPointer in FFDC. Below is what logged. I am not able to make out what is wrong. Any indication…

Bharath
- 259
- 1
- 13
-2
votes
1 answer
Closing InitialContext vs initialising it to null
A little bit confused - lets say we create InitialContext and DataSource like this:
InitialContext ctx = new InitialContext();
DataSource ds = ((DataSource) ctx.lookup("jdbc/hsqldb"));
Now when some database operations are made, I suggest ctx…

Ernestas Gruodis
- 8,567
- 14
- 55
- 117