3:30 code demo 4:06 (naming) *service provider* configuration 5:28 in this example case, 5:38 specify: use file system as service provider
@PriyankaShinde-mp6lt5 жыл бұрын
I have created a topic in jms module in weblogic but while searching with it's jndi name I'm not able to lookup the topic. How to lookup that topic? Thank you..
@ashishburnwal90105 жыл бұрын
Thank you for clear explanation, I have one question, let say I have a web-app called myApp, and it contains a context.xml. And during deployment the name of the context.xml is automatically changed to myApp.xml. Then how does the context lookup happens, given we are doing it with Context envContext = (Context)initContext.lookup("java:comp/env"); How java:comp/env does all the magic?
@takuntorfred22129 жыл бұрын
Thank you Sir. Good simple practical explanation. Even a novice like me can understand. Thank you.
@thecritique546410 жыл бұрын
Best explanation of the concept. +1
@galmalachi48599 жыл бұрын
thank you very much! very helpful and well explained!
@takuntorfred22129 жыл бұрын
Sir I am using your tutorial to learn jndi. I have set up my code exactly as your own. But when I run it gives a null pointer exception. I am pasting the code below for your review. Please help; Thanks. import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import java.util.*; public class Ctxclass{ public static void main(String[] args) throws NamingException { Hashtable env= new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory"); env.put(Context.PROVIDER_URL,"file:/C:/"); Context ctx = new InitialContext(env); Driver xyz = new Driver("princeton", "rav4"); ctx.bind("best driver", xyz);}} import javax.naming.NamingException; import javax.naming.Reference; import javax.naming.Referenceable; import javax.naming.StringRefAddr; public class Driver implements Referenceable { String name; String model; Driver(String name, String model) throws NamingException{ this.name = name; this.model = this.model;} @Override public Reference getReference() throws NamingException { Reference bill = new Reference(Driver.class.getName()); bill.add(new StringRefAddr(name, this.name)); bill.add(new StringRefAddr(model, this.model)); return bill;}} Exception in thread "main" java.lang.NullPointerException at java.util.Hashtable.put(Unknown Source) at com.sun.jndi.fscontext.RefFSContext.addObjectToBindings(RefFSContext.java:517) at com.sun.jndi.fscontext.RefFSContext.bindObject(RefFSContext.java:337) at com.sun.jndi.fscontext.RefFSContext.bind(RefFSContext.java:169) at com.sun.jndi.fscontext.FSContext.bind(FSContext.java:167) at javax.naming.InitialContext.bind(Unknown Source) at Ctxclass.main(Ctxclass.java:22)
@jedu13529 жыл бұрын
Takuntor Fred I'd try working with D:\ partition. Windows can be very tricky and restrictive about creating files at root of C partition.
@takuntorfred22129 жыл бұрын
jEdu Thank you so very much sir. Thank you for responding. I tried your suggestion and it worked perfectly.Thanks. I'm really grateful.
@aaroldaaroldson7086 жыл бұрын
4:08 We may access the Naming Service with anus service provider??? What are you saying??? Fix your audio or add subs PLEASE!