Java Naming and Directory Interface (JNDI)????

What do u mean by JNDI and what is the use of this Interface.
Could someone make me literate on this topic..
.................ABHI

Its never too late to get back to the basics, what do
you expect when u are designing a web Service and
suddenly you don't remember the exact defntions of
these terms. If you design web services in Java, you normally do not suddenly forget what the difference between J2SE and J2EE is. And you normally know that you can't compile with JRE.
Hey, there is a difference in reading a big
article and asking someone who has already understood
the concept.If you would have read the text on the buttons on the HOME (or START-)-Page of java.sun.com, your question about J2EE and J2SE would have been already answered.
The question is, what it pays asking simple questions and get short answers. And if you do not know what J2SE, J2EE, JRE, SDK... are.. I do not believe, that you're really developing web applications in Java. And if I'm wrong it is much worse! That would meen someone's programming Java-applications without even knowing the basics!

Similar Messages

  • Naming and Directory (JNDI) - Hibernate can't execute query in JBOSS

    Hi All,
    I m trying to run one application locally in jboss. I m able to run the app successfully locally with using the proxool.properties where all the dev DB connection stuff is there. The concern is that while i m trying to access the DB with JNDI connection. For that i did the following.
    in the C:\Program Files\EnterprisePlatform-4.3.0.GA\jboss-as\server\default\deploy i have oracle-ds.xml where JNDI entry is as follows :
    <local-tx-datasource>
    <jndi-name>rtcDS</jndi-name>
    <connection-url>******</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>XXX</user-name>
    <password>XXX</password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>10</max-pool-size>
    <prepared-statement-cache-size>0</prepared-statement-cache-size>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
    <metadata>
    <type-mapping>Oracle9i</type-mapping>
    </metadata>
    </local-tx-datasource>
    In the hibernate-configuration file i did the following:
    <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
    <!--<property name="proxool.pool_alias">pool1</property>
    <property name="proxool.properties">com/eaton/electrical/rtc/proxool.properties</property>-->
    <property name="connection.datasource">java:/rtcDS</property>
    <property name="show_sql">true</property>
    <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
    The method where the exception throws is as follows.:
    public List findByProperty(String propertyName, Object value) throws DAOException{
    //log.debug("finding Users instance with property: " + propertyName + ", value: " + value);
    try {
    String queryString = "from Users as model where model."+ propertyName + "= ?";
    Query queryObject = this.hibSession.createQuery(queryString);
    queryObject.setParameter(0, value);
    return queryObject.list(); ----> Throwing exception from here with JNDI connection
    } catch (RuntimeException re) {
    log.error("find by property name failed", re);
    throw re;
    While trying to access the application with this i m facing the following exception while login: Somewhat seems i m operating on the closed connection. I tried some of the stuufs but could not able to resolve the issue. May be someone already faced such issues. Please let me know if anyone needs any more information on this. Thanks in advance !!!
    ERROR [org.apache.catalina.core.ContainerBase] Servlet.service() for servlet jsp threw exception
    java.sql.SQLException: Closed Connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:564)
    at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:538)
    at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:349)
    at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:344)
    at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:187)
    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:396)
    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334)
    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
    at org.hibernate.loader.Loader.doQuery(Loader.java:390)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
    at org.hibernate.loader.Loader.doList(Loader.java:1593)
    at org.hibernate.loader.Loader.list(Loader.java:1577)
    at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:890)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    at org.apache.jsp.common.pages.errorPages.errorBody_jsp._jspService(errorBody_jsp.java:89)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:614)
    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101)
    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137)
    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758)
    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890)
    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
    at org.apache.jsp.common.templates.errorPage_jsp._jspx_meth_tiles_005finsert_005f3(errorPage_jsp.java:443)
    at org.apache.jsp.common.templates.errorPage_jsp._jspx_meth_html_005fhtml_005f0(errorPage_jsp.java:217)
    at org.apache.jsp.common.templates.errorPage_jsp._jspService(errorPage_jsp.java:99)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:614)
    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101)
    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137)
    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758)
    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890)
    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
    at org.apache.jsp.common.pages.errorPages.databaseError_jsp._jspx_meth_tiles_005finsert_005f0(databaseError_jsp.java:144)
    at org.apache.jsp.common.pages.errorPages.databaseError_jsp._jspService(databaseError_jsp.java:79)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)

    Did you get this issue resolved?
    Can you post the resolution please?

  • JBoss and local interfaces (JNDI)

    I'm trying to do simple example involving local interfaces on JBoss.
    There is Bar remote interface, which uses Foo, local interface. And the problem is - i cant locate Foo within Bar:
    ejb-jar.xml:
    <session>
    <ejb-name>BarEjb</ejb-name>
    </session>
    <entity>
    <ejb-name>FooEjb</ejb-name>
    </entity>To make FooEjb accessible for Bar via local interface, as manual says, i have to put additional reference in ejb-jar.xml for Bar:
    <ejb-local-ref>
         <ejb-ref-name>LocalFooEjb</ejb-ref-name>
         <ejb-ref-type>Entity</ejb-ref-type>
         <local-home>beans.FooHome</local-home>
         <local>beans.Foo</local>
         <ejb-link>FooEjb</ejb-link>
    </ejb-local-ref>But it doesnt change anything, JBoss maps Foo like this: "Bound EJB LocalHome 'FooEjb' to jndi 'local/FooEjb@13595063'", and
    public class  Bar ... {
    Object ref = context.lookup("LocalFooEjb");
    }resuluts in exception:
    "java.lang.RuntimeException: LocalFooEjb not bound ..."
    Question: how do i map local interfaces within JBoss to some human-readable and predictable name?
    Thanks for help.
    update:
    specifying JNDI names in jboss.xml does the trick, but i still dont understand why JBoss ignores local-ref element. So anyone who can explain is welcome.
    jboss.xml
    ...xml declaration..
    <jboss>
         <enterprise-beans>
              <session>
                   <ejb-name>StockListEjb</ejb-name>
                   <jndi-name>remote/StockListEjb</jndi-name>
              </session>
              <entity>
                   <ejb-name>StockEjb</ejb-name>
                   <local-jndi-name>local/StockEjb</local-jndi-name>
              </entity>
         </enterprise-beans>
    </jboss>Edited by: anykeyN on Jun 29, 2008 7:06 AM

    [skipped]

  • Using LDAP as Naming and Directory Services of Weblogic

    Hi All,
    I wan to use LDAP(using Netscape Directory Server 4.2 as LDAP server) with weblogic5.1. I want that beans should be bound this LDAP server when they are deployed. For this what I have to change in configuration?
    Anyother suggestions related to using LDAP with weblogic are welcome. In this regard, I want to ask whether weblogic application server has LDAP server built into it or not.
    Thanks and Regards,
    sudarson

    As I understand from your reply, you are suggesting me to bind the beans to LDAP server within the bean class's setentitycontext ? Is it so ? Can we not configure even this feature in weblogic6.0 also ? One thing more, if do this kind of thing then jndiname will be hardcoded into the bean class and can't be changed by simply editing the deployment descriptor. Pls suggest.
    Regards,
    sudarson
    "Michael Girdley" <----> wrote:
    >
    >
    This is not possible through configuration at the current time. One thing
    you could do is have your EJBs make a connection to your LDAP server and
    register themselves when they are deployed.
    Michael Girdley
    BEA Systems
    Learning WebLogic? http://learnweblogic.com
    "sudarson" <[email protected]> wrote in message
    news:3a755fd5$[email protected]..
    Hi All,
    I wan to use LDAP(using Netscape Directory Server 4.2 as LDAP server)with weblogic5.1. I want that beans should be bound this LDAP server when
    they are deployed. For this what I have to change in configuration?
    Anyother suggestions related to using LDAP with weblogic are welcome. Inthis regard, I want to ask whether weblogic application server has LDAP
    server built into it or not.
    Thanks and Regards,
    sudarson

  • Java, Flash and MIDI interface...

    Hey all!
    Im currently researching my final year project in college, im creating a program that teaches children musical notation through an attractive GUI and incorporates a MIDI device.
    The GUI will be handled by Flash, but the MIDI keypresses will be handled by java (i dont think flash can handle MIDI input) does anyone know if flash and java will be able to interact?
    For example, i hit a key on the keyboard, java handles in the keypress and tells Flash to highlight a virtual keyboard on the screen. Can this be done?
    Replies would be really appreciated!!

    This isn't a Flash forum, so I think you'll be lucky to get Flash specific answers.
    When you get these sort of horrible technical problems it's usually a "design problem". . In this case, the simple answer is to write the whole thing in Java.
    If you don't know how to write the GUI in Java, then that's the question you should be posing.
    Eg. You might take a digital photo above an actual musical keyboard.
    Then display this in a java application. Work out the pixel coordinates of each and every key, and paint that key everytime someone presses it......
    regards,
    Owen

  • Jndi properties in InitialContext : java.naming.factory.initial

    I am trying to lookup a bean with the following code. I get a NamingException on line 9 when the jndi properties are referenced. The exception message that I receive is "Cannot instantiate class: org.jnp.interfaces.NamingContextFactory". Does anyone know what the problem may be?
    1 // Set the jndi properties
    2 Properties jndiProps = new Properties();
    3 jndiProps.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    4 jndiProps.setProperty("java.naming.provider.url", "localhost:1099");
    5 jndiProps.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
    6 try
    7 {
    8 Context ctx = new InitialContext(jndiProps);
    9 homeMyBean = (LocalMetricResultsHome) ctx.lookup("MyBean");5
    10 }
    11 catch (NamingException e)
    12 {
    13 // handle namingexception
    14 }

    It means the .jar file containing that class is not in your ClassPath. Try putting jnp-client.jar into your ClassPath.

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • Copying files from same directory as *.java files and moving to WEB-INF/classes/ package name

    In our current application we have the following source directory structure:
              src -
              - com
              - edeploy
              - subdirs ... (many directories here)
              - jsp
              -subdirs ... (many directories here)
              In com.edeploy.subdirs, there exists *.java files, and *.gxq files (query
              files). I would like to modify my build.cmd script to copy the *.gxq files
              into the same directory as the class files.
              Here's my script so far:
              @REM Create list of files to compile
              DIR /S /B /A:-D src\com\*.java >class.list
              @REM Create list of query files
              DIR /S /B /A:-D src\com\*.gxq >query.list
              @REM Compile
              javac -d stage\WEB-INF\classes @class.list
              @REM Copy query files into class directory
              .......... code needed here ......
              Can anyone help me with this?
              Thanks,
              Matt
              

    You may want to check out:
              http://jakarta.apache.org/ant/index.html
              Gary
              "Matt Raible" <[email protected]> wrote in message
              news:[email protected]..
              > In our current application we have the following source directory
              structure:
              >
              > src -
              > - com
              > - edeploy
              > - subdirs ... (many directories here)
              > - jsp
              > -subdirs ... (many directories here)
              >
              >
              > In com.edeploy.subdirs, there exists *.java files, and *.gxq files (query
              > files). I would like to modify my build.cmd script to copy the *.gxq
              files
              > into the same directory as the class files.
              >
              > Here's my script so far:
              >
              > @REM Create list of files to compile
              > DIR /S /B /A:-D src\com\*.java >class.list
              >
              > @REM Create list of query files
              > DIR /S /B /A:-D src\com\*.gxq >query.list
              >
              > @REM Compile
              > javac -d stage\WEB-INF\classes @class.list
              >
              > @REM Copy query files into class directory
              > .......... code needed here ......
              >
              > Can anyone help me with this?
              >
              > Thanks,
              >
              > Matt
              >
              >
              

  • How is the interface between the Java Stack and ABAP stack is achieved?

    How is the interface between the Java Stack and ABAP stack is achieved?..Please send me the answer to [email protected]

    Hi,
    By interface, I assume you mean the connection between the ABAP and the Java stacks in a double stack system.
    The connection from Java to ABAP is through JCo connections defined in the WebDynpro section of the J2EE start page. So Java to ABAP requests are processed through JCo.
    The connection from ABAP to Java is through RFC connections defined in TA SM59. The ABAP to Java requests are processed through RFC.
    Refer https://dsd.esco-salt.com/StartPage/documents/integration/3.html for detailed explanation.
    The UME can be maintained in either ABAP or in JAVA depending on the persistence.
    Refer: http://help.sap.com/saphelp_nw70/helpdata/en/5b/5d2706ebc04e4d98036f2e1dcfd47d/frameset.htm
    Check UME data source configuration.
    Some quick FAQs can be found at:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad47eb90-0201-0010-7cb2-ddfa5ed879ec
    Hope this helps.
    Best Regards,
    Srividya.R

  • Help please: re proper use of JNDI and Directory services

    I'm new to this J2EE/JDev stuff and have spent a few days pouring over Sun's JNDI and J2EE documentation as to how best to accomplish my task. Here's the big picture. I am constructing a web site in my PC at home for eventual deployment in an ISP server. I don't have an LDAP or COS server but ISPs usually do. I've found a public LDAP server I can use but the problem is getting an entry on the server that my JSP client and EJB server code can use to find my Entity bean and SQLServer database server respectively. The best I've been able to come up with is that I need to write my own Applet or client application to register my entries on that LDAPserver with appropriate Java attributes and then code my stuff to look it up using the DirContext class.
    As for how I pass my stuff into my EJB bean, I intend to use jndi.properties to specify custom properties that map logicals to the physical resources that DirContext routines act on and use System.getProperty("...") to retrieve them dynamically without having to recode later. I haven't figured out exactly how to do this for Servlets and JSPs yet so they can find the beans.
    I'm interested in any feedback to what I'm doing and how better to achieve my ends.
    As an aside, I noticed as I poured through Sun's J2EE container software that they seem to have embedded COS in their deploytool as a nice feature that would effectively solve my problem if JDeveloper could integrate such a capability. Their sample programs were pretty straight-forward in configuring JDBC and the beans. Any thoughts from the JDev team on providing a similar capability for OC4J?
    Thanks,
    Dean

    I would first left-click with the mouse on the camera icon (to enable/activate the snap shot feature), then I'd go with the mouse to the area I wanted to take the snapshot, click-and-drag so I would box-in the desired area to be copied/duplicated, then let go off the mouse (a ding wound then sound) and finally I would go to the page where I wanted to reproduce the snapshotted and left-click once with the mouse... And presto!
    Not so with 11-Pro. It allows me to paste onto a different program such as MS-Word (or Outliok), but not onto a PDF page.
    ⚽ is☝

  • Comparable and comparator interface in java

    Hi All,
    How comparable and comparator interface works in java and when to use comparable and when to use comparator.please give me some example(code) as I am not able to understand the difference.
    Thanks
    Sumit
    Edited by: sumit7nov on May 17, 2009 4:45 AM

    Thanks,one more doubt.
    We have Collections.sort() method and we can sort any list by this method without implementing comparable or comparator interface.Then my question is when we need to implement comparable or comparator interface or when do we write our own compareTo() or compare() methods.
    Thanks
    Sumit

  • Difference between interfaces in Java API and user defined interfaces

    Is there any differences between the interfaces (such as KeyListener, ActionListener and EventListener etc.,) in Java API and the user defined interfaces.
    The user defined interfaces seems to be empty without any functionality (except its constant and method declarations). But the interfaces in Java API seems to have some functionality behind them, since they route the device events to the programs.
    Actually what is happening behind the Java API's interfaces?
    Please clarify.

    Ummm, no they are not (or at least some of them are not). Also, some things we support now we may not have supported in a previous release.
    If you look at the section 2 (Working with TimesTen Data Stores0 in the TimesTen Java Developer's Guide and look at the sections:
    TimesTen JDBC Extensions
    Additional TimesTen classes and interfaces
    then you will see the extra functionality documented there. Of course, if you do not need any of this functionality then you can simply treat them as the base classes from java.sql and they will work fine so it is easy to make most of your code generic.
    Chris

  • Authentication on Active Directory using JNDI (A Proffessional Appraoch)

    I am using following code for getting authenticated on Active Directory by user logon name.
    Can any one tell me a more proffessional and fool proof appraoch for authenticating a user on Active Dir through my web interface ???
    thanks in advance
    * Created on Nov 10, 2004
    package auth;
    import java.util.Hashtable;
    import javax.naming.AuthenticationException;
    import javax.naming.Context;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import javax.naming.directory.DirContext;
    import javax.naming.directory.InitialDirContext;
    import javax.naming.directory.SearchControls;
    import javax.naming.directory.SearchResult;
    * @author Tushar Agrawal
    * Created On Nov 10, 2004
    public class UserAuthentication {
         public UserAuthentication() {
              super();
         public NamingEnumeration loginToActiveDirectory(
              String logonName,
              String password,
              String domain) {
              boolean success = false;
              NamingEnumeration attrs = null;
              Hashtable env = new Hashtable(11);
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.SECURITY_AUTHENTICATION, "simple");
              env.put(Context.PROVIDER_URL, "ldap://domain:389/dc=SECLORE,dc=com");
              env.put(Context.SECURITY_PRINCIPAL, logonName + "@" + domain);
              env.put(Context.SECURITY_CREDENTIALS, password);
              //env.put(Context.SECURITY_PROTOCOL, "ssl");
              env.put("java.naming.ldap.version", "3");
              env.put(Context.REFERRAL, "follow");
              try {
                   String base = "";
                   DirContext ctx = new InitialDirContext(env);
                   SearchControls controls = new SearchControls();
                   controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   controls.setReturningAttributes(
                        new String[] {
                             "sAMAccountName",
                             "userPrincipalName",
                             "displayName",
                             "memberOf",
                             "objectSid",
                             "title" });
                   NamingEnumeration e =
                        ctx.search(base, "sAMAccountName=" + logonName, controls);
                   if (e.hasMore()) {
                        SearchResult r = (SearchResult) e.next();
                        attrs = r.getAttributes().getAll();
                        /*while (attrs.hasMore()) {
                             System.out.println(attrs.next());
                        ctx.close();
              } catch (AuthenticationException e) {
                   System.err.println("Problem getting attribute: " + e);
                   success = false;
              } catch (NamingException e) {
                   System.err.println("Problem getting attribute: " + e);
                   success = false;
              return attrs;
    tushar agrawal

    You''l find more info at :
    http://jakarta.apache.org/tomcat/tomcat-5.5-doc/catalina/funcspecs/fs-jndi-realm.html
    http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html
    That's the right way to do it.

  • How to set java.naming.provider.url when multiple oc4j instances in iAS

    Hi Folks,
    I have problems engaging a connection to a deployed application in a 9.0.3 iAS instance. I created 2 oc4j instance within the iAs instance.
    I wonder how to set up the JNDI provider url?!?
    According http://download-west.oracle.com/docs/cd/A97329_01/web.902/a95879/jndi.htm
    the provider url contains of ormi://host:port/application.
    Unfortunatly I get a connection refused Naming Exception.
    What's wrong?
    Where can I look up the
    java.naming.security.principal
    java.naming.security.credentials
    Are they set by default?
    I tried the following scenario:
    java.naming.provider.url=ormi://host/oc4j-instance/application/
    and a user/password from principals.xml in the application/config directory, but don't have any success.
    So please help me ;-).
    Bye & Thx
    Toby

    This is correct as far as aI remember
    1) java.naming.provider.url = t3://server1:port1,server2:port2
    see
    http://download.oracle.com/docs/cd/E13222_01/wls/docs81/jndi/jndi.html -- Using WebLogic JNDI from a Client in a Clustered Environment

  • Remote and Home interface binding to an EJB2.1/3.0 bean.

    When deploying a complete ejb bean,
    -What associated a bean class, within the container,
    with it's home and remote interfaces?
    -JBoss Application server requires that the Bean class
    directly implement both interfaces.
    -Assuming EJB 2.1, is this approached by
    interface implementation, a naming convention,
    a common location in a package/directory,
    or is this put in the deployment descriptor xml file?
    What is the standard approach?
    Z.

    If you have included the HTTP server with your 10.1.3.2 installation you could also setup a proxy/proxy-reverse setup in the portal http server for the /app08 mountpoint and point this to your 10.1.3.2 server....

Maybe you are looking for