This discussion is archived
1 Reply Latest reply: Sep 2, 2012 10:10 AM by 817264 RSS

javafx2 connection galssfish jndi data source error

928958 Newbie
Currently Being Moderated
I am writing the connection

Properties props = new Properties ();
/ / JNDI initialization factory
props.setProperty ("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty ("java.naming.provider.url", "iiop :/ / 192.168.9.7:3700");
InitialContext ic = new InitialContext (props);

DataSource ds1 = (DataSource) ic.lookup ("java/env/zygj");
................

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1435)
... 41 more
Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/env/zygj' in SerialContext[myEnv={java.naming.provider.url=iiop://192.168.9.7:3700, java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NamingException: Invocation exception: Got null ComponentInvocation ]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at javafxapplication11.SampleController.handleButtonAction(SampleController.java:46)
... 46 more
Caused by: javax.naming.NamingException: Invocation exception: Got null ComponentInvocation
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.getComponentId(GlassfishNamingManagerImpl.java:873)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:742)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:169)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 49 more


What can I do? Thanks very match!!

Edited by: user7993481 on 2012-9-2 上午12:28

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points