How to access exchange server's features with java?

I can send/receive mail to MS Exchange Server using JavaMail API. Thats working fine but is it possible to acess other features of MS Exchange Server? At least is it possible to get the list of users in exchange server using java?

JavaMail only speaks the standard internet protocols. I know very little about Exchange,
but I suspect many of its features are not accessible using standard internet protocols.
It's very unlikely that you can get a list of users using one of the standard internet mail
protocols. Certainly none of the protocols support that as a standard feature.

Similar Messages

  • Accessing Exchange Profile Parameters programatically (using Java/ ABAP)

    Hi All,
    Exchange Profile parameters can be accessed using the URL http://<server>:<port>/exchangeProfile
    Does anyone know how to access 'Exchange Profile parameters' programatically. (from java).
    Code snippet for the same would be of great help.
    Regards,
    Siva Maranani

    Hi,
    Is there any way to access exchange profile parameters using Java?
    I need to access exchange profile from an UDF.
    Thanks in advance.
    Pedro Leal

  • Im not satasfied with 6.0 i miss youtube and some apps are slower, facebook wants premission to access my contacts, and how do i use apple tv feature with out mirroring?

    Im not satasfied with 6.0, i miss youtube, some apps are slower, facebook wants premission to access my contacts, and how do i use apple tv feature with out mirroring?

    That is awesome, works perfectly.
    I'll get it worked into my main script. Is this Action Manager code, and not just regular Javascript from the Scripting Dictionary? I can't tell the difference. I'll see whether or not it's actually faster than Applescript.
    Thanks. I know Scripting Listener records a bunch of stuff, but it's pretty amazing to me that playing back this line does the same thing that playing back the 1,011 lines Scripting Listener puts out.
    Thanks.

  • How to install Exchange Server 2010 with the name of my existing Domain Controller.

    I have my Primary domain Controller as abc.com in 2008 r2 standard. abc.com is registered. I want to set up Fresh Exchange Server 2010 sp2 with the name of the same
    abc.com domain name. Please guide me the steps how to do that. Waiting for your kind response. :)

    Hi,
    From you description, you want to install an Exchange server 2010 in the abc.com. When you set up your Exchange, Exchange need to join in a domain. You just need to specify the domain to abc.com.
    What's more, here is a helpful blog about Exchange 2010 installation for your reference.
    HOWTO Install Exchange 2010 - Step by Step
    http://blogs.technet.com/b/ferris/archive/2010/03/05/howto-install-exchange-2010-step-by-step.aspx
    Hope it helps.
    Best regards,
    Amy
    Amy Wang
    TechNet Community Support

  • Outlook 2010 Exchange Server 2010 to Exchange Server 2013 Features

    Hi All
    We have recently upgraded from Exchange Server 2003 to Exchange Server 2010. We are using the Outlook 2010 (32 bit) email client. When mailboxes were moved on to the new server various features inside the system were activated. For email Internal Out of
    Office Messages, External Out of Office Messages, notifications in the email recipient bar when creating emails if the user was out of office.
    What new features would be available with Outlook 2010 (32 bit) and Exchange 2013. And are they dependent on the Office Service Pack?
    Kind Regards
    Please note that I have previously posted this in another forum but was advised to post here in this forum.

    Hi,
    I find your post on Office forum:
    http://social.technet.microsoft.com/Forums/en-US/fc538968-212c-411c-8ce8-0ef1d7acfcca/outlook-2010-exchange-server-2010-to-exchange-server-2013-features?forum=outlook
    The Steve's answer is comprehensive, great links on Exchange 2013 new features and removed features.
    About "And are they dependent on the Office Service Pack?", I will give the answer.
    Based on my knowledge, when new SP releases, it include enhancements in security and compliance, architecture and administration, and user experiences.
    For example, Exchange 2013 SP1, it connects to Outlook 2013 SP1 via MAPI over HTTP.
    If you want to know more about the Exchange new features, please see Exchange Team Blog.
    Find blog about SP1 for your reference:
    http://blogs.technet.com/b/exchange/archive/2014/02/25/exchange-server-2013-service-pack-1-available.aspx
    Thanks
    Mavis
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Mavis Huang
    TechNet Community Support

  • Accessing Exchange Server Property

    Hi:
    I have a VB Script program that access Exchange server. I need to migrate it to Java. The LDAP connection is working. But I can not retrieve the msExchMessageJournalRecipient property. Could you help?
    Thank in advance.
    VB Script
    Set oConnection = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    wscript.echo "Journaling Flag Sample Start -- " & Date & " -- " & Time
    oConnection.Provider = "ADsDSOObject"  'The ADSI OLE-DB provider
    oConnection.Open "ADs Provider", _
         "USERNAME", "PASSWORD"
    set objCommand =createObject("ADODB.Command")
    objCommand.ActiveConnection = oConnection
    objCommand.Properties("Page Size") = 900
    strQuery = "<LDAP://SERVERNAME/" & _
         "CN=Administrative Groups,CN=COMPANY_NAME,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=WINROOT,DC=COMAPANY_NAME,DC=com>;" & _
         "(objectClass=msExchPrivateMDB);" & _
         "ADsPath,msExchMessageJournalRecipient" & _
         ";subtree"
    objCommand.CommandText = strQuery
    Set rs=objCommand.Execute
    adp = rs("ADsPath").value
    jrnl = rs("msExchMessageJournalRecipient").valueJava code
         public static void main(String[] args) {
              NamingEnumeration results = null;
              DirContext ctx = null;
              try {
                   Hashtable env = new Hashtable();
                   env
                             .put(Context.SECURITY_PRINCIPAL, "USERNAME");
                   env.put(Context.SECURITY_CREDENTIALS, "PASSWORD");
                   DirContext init = new InitialDirContext(env);
                   ctx = (DirContext) init
                             .lookup("ldap://SERVER");
                   SearchControls controls = new SearchControls();
                   controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   results = ctx
                             .search(
                                       "CN=Administrative Groups,CN=Company,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=WINROOT,DC=Company,DC=com",
                                       "(objectClass=msExchPrivateMDB)", controls);
                   if (results.hasMore()) {
                        SearchResult sres = (SearchResult) results.next();
                        Attributes attributes = sres.getAttributes();
                        NamingEnumeration attrEnum = attributes.getAll();
                        while (attrEnum.hasMore()) {
                             System.out.println("Attribute: "attrEnum.next().toString());
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   if (results != null) {
                        try {
                             results.close();
                        } catch (Exception e) {
                             e.printStackTrace();
                   if (ctx != null) {
                        try {
                             ctx.close();
                        } catch (Exception e) {
                             e.printStackTrace();
         }

    Did you prepare Windows 7 for cooperating with Exchange 2013?
    On Exchange 2013 prereq site is procedurę:
    Install the following software in the order shown:
    Microsoft .NET Framework 4.5
    The version of Windows Management Framework that corresponds to the version of Exchange 2013 you're installing.
    Exchange 2013 CU3   Windows Management Framework 3.0
    Exchange 2013 SP1 or later   Windows Management Framework 4.0
    Knowledge Base article KB974405 (Windows Identity Foundation)
    Regards, Konrad Sagala, MCT, MCSE+M, MCITP: Exchange 2007/2010, Lync 2010, Office365, Windows 2008, Virtualization

  • Is there any way to block accessing Exchange server

    Hello,
    We are using iPhone as a business phone to
    access Exchange server using ActiveSync.
    Is there any way to block non-company, in
    other words private iPhone, iPhone to access
    Exchange Server?
    Some users have 2 iPhones (1 provided by our
    company, 1 purchased by himself/herself as
    a his/her private phone).
    We would like to block those non-company iPhone.
    If there is a way(s), please let me know!!
    Thank you very much in advance.
    Regards,
    Tak

    Block/Delete will appear if "Enforce Password on Device" is NOT ticked in ESM at the time when that particular iPhone (or other smartphone) was first joined to EAS.
    Wipe/Delete will appear if "Enforce Password on Device" IS TICKED in ESM at the time when that particular iPhone (or other smartphone) was first joined to EAS.
    The only difference is, if you first have "Enforce..." ticked and you join phones A,B,C, - they will always have WIPE next to that phone even if X months down the line, you untick "Enfore...".
    If at that point (after unticking "Enforce..") you join phones D,E,F, they will have BLOCK next to their phone and always will have until you tick the "Enforce..." again and the user will be prompted to input a code when they next sync.
    Again I repeat, the 'Lock code' when inputted into the phone acts as an agreement between the user & exchange that exchange has permission to wipe the phone remotely. Without that agreement ("Enforce..."), you should not have the WIPE function on those particular phones.
    Hope that makes sense.

  • How to Configure Exchange server in EP6.0

    Hi
    How to configure mailing server in Portal
    With Regards
    Azhar

    Hi Azhar
    You can specify your mail server on the Portal.
    Go to System Administration -> System Configuration -> UM Configuration.
    You will find a field there to specify your mail Server.
    You may also have to specify this in the config tool of your WAS Server to enable email notification
    Take a look at <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/07/9bda3d5ed05610e10000000a114084/frameset.htm">this</a> .
    Hope that helps.
    Best Regards
    Priya

  • I update my exchange server 2013 cu6 with exchange 2007 and my exchange 2013 db shutdown every 25 minute and recover. You have any hotfix I can use for this solution.

    I update my exchange server 2013 cu6 with exchange 2007 and my exchange 2013 db shutdown every 25 minute and recover. You have any hotfix I can use for this solution.

    Hi,
    From your description, you have deployed Microsoft Exchange Server 2013 and Microsoft Exchange Server 2007 in a co-existence environment. After you upgrade to CU6, databases unexpectedly shut down. In your case, here is a kb for your reference.
    Exchange Server 2013 databases unexpectedly fail over in a co-existence environment with Exchange Server 2007
    http://support2.microsoft.com/kb/2997209
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • How can I compact a MSAccess database with java?

    Hi.
    I have a question (Please Help!!!):
    How can I compact a MSAccess database with java-jdbc? Is it posible?
    Thanks

    MS Access database has a max length limitation of 2.14GB for Access 2000( 1.07G for Access 97), and won't recycle basically space for update/delete sql so tha it's a good idea to use MS Access database for program, which need update/delete frequent ly data. The programmers of HXTT Access(www.hxtt.net) are writing code for CREATE TABLE/DATABASE sql now. If you need a pure Java solution for PACK TABLE/DATABSE urgently in your project, you should send such a requirement to the Support page of www.hxtt.net so that they can schedule complementing such a fucntion. Otherwise, you should pack your databae manually or visit C++ code for Compact an Access Database Programmatically at
    http://www.codeguru.com/Cpp/data/mfc_database/microsoftaccess/article.php/c4327/ , or use Easy Microsoft Access MDB MDE Compactor at http://www.easyhr.com.au/software/easy_mdb_mde_compactor.htm.

  • Crystal Report Server 2008 integration with java application

    Hi All,
    Any of you having complete document about Crystal Report Server 2008 integration with java application....like source code and what are all the jar files needed? Or tell me that the implementation is same as Crystal Report Server XI R2?
    Thanks

    Have you looked at the BusinessObjects Enterprise XI 3.x Java Developer Guide?
    [http://www.sdn.sap.com/irj/boc/sdklibrary]
    Sincerely,
    Ted Ueda

  • Need Documentation on how to intehrate Exchange server 2007 with SAP portal

    hi,
    i need some documentation on how to integrate microsoft Exchange server 2007 with SAP portal.
    can anybody help?

    Hi Payel,
    Pls check the links below..
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/7a/ec015c8446d447a83776d40f31c84f/content.htm">Link</a>
    Note : As specified in the document,  only the following versions of Microsoft Exchange server are supported:
    &#9679;     Exchange Server 2000
    &#9679;     Exchange Server 2003
    Regards,
    Venkat.

  • Exchange Server 2013 64bit with SP1 Standard - Readiness Checks/Prerequisite Analysis

    I'm trying to install Exchange 2013 with SP1 on Windows Server 2012 R2 Standard, at the Readiness Checks setup, I get 25 errors. Before the Readiness Checks setup, I had selected 'Automatically install Windows Server roles and features that are required
    to install Exchange Server'. How come they are not automatically installed? Do I have to manually install these 25 items? That's a lot of work.
    The Readiness Checks - Prerequisite Analysis produces this:
    Error:
    This computer requires Windows Media Audio Voice Codec. Install the Desktop-Experience component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornWmspdmoxNotInstalled.aspx
    Error:
    The World Wide Web (W3SVC) service is either disabled or not installed on this computer. You must exit Setup, install the required component, and then restart Setup.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.W3SVCDisabledOrNotInstalled.aspx
    Error:
    The 'IIS 6 Metabase Compatibility' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS6MetabaseNotInstalled.aspx
    Error:
    The 'IIS 6 Management Console' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS6MgmtConsoleNotInstalled.aspx
    Error:
    The 'IIS 7 Dynamic Content Compression' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS7HttpCompressionDynamicNotInstalled.aspx
    Error:
    The 'IIS 7 Static Content Compression' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS7HttpCompressionStaticNotInstalled.aspx
    Error:
    The 'Windows Process Activation Service Process Model' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornWASProcessModelInstalled.aspx
    Error:
    The 'IIS 7 Basic Authentication' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS7BasicAuthNotInstalled.aspx
    Error:
    The 'IIS 7 Windows Authentication' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS7WindowsAuthNotInstalled.aspx
    Error:
    The 'IIS 7 Digest Authentication' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS7DigestAuthNotInstalled.aspx
    Error:
    The 'IIS 6 WMI Compatibility' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS6WMICompatibility.aspx
    Error:
    The 'ISAPI Filter' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornISAPIFilter.aspx
    Error:
    The 'Client Certificate Mapping Authentication' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornClientCertificateMappingAuthentication.aspx
    Error:
    The 'Directory Browsing' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornDirectoryBrowse.aspx
    Error:
    The 'HTTP Errors' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornHttpErrors.aspx
    Error:
    The 'HTTP Logging' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornHttpLogging.aspx
    Error:
    The 'HTTP Redirection' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornHttpRedirect.aspx
    Error:
    The 'Tracing' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornHttpTracing.aspx
    Error:
    The 'Request Monitor' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornRequestMonitor.aspx
    Error:
    The 'Static Content' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornStaticContent.aspx
    Error:
    The 'Web-Mgmt-Service' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.ManagementServiceInstalled.aspx
    Error:
    This computer requires the Microsoft Unified Communications Managed API 4.0, Core Runtime 64-bit. Please install the software from http://go.microsoft.com/fwlink/?LinkId=260990.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.UcmaRedistMsi.aspx
    Error:
    The 'IIS Management Console' component is required. Install the component via Server Manager.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.LonghornIIS7ManagementConsoleInstalled.aspx
    Warning:
    Installing Exchange Server on a domain controller will elevate the permissions for Exchange Trusted Subsystem to domain administrators.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.WarningInstallExchangeRolesOnDomainController.aspx
    Thanks

    I didn't have to do this during setup with Exchange 2013 non SP1 on Windows Server 2012 Standard non R2.
    I just ran the PowerShell command to install the Windows components on win2k12 r2 and Readiness Checks - Prerequisite Analysis came down to 1 error
    prerequisites that are needed to install Exchange 2013 on a Windows Server 2012 R2 or Windows Server 2012
    Error:
    This computer requires the Microsoft Unified Communications Managed API 4.0, Core Runtime 64-bit. Please install the software from http://go.microsoft.com/fwlink/?LinkId=260990.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.UcmaRedistMsi.aspx
    Warning:
    Installing Exchange Server on a domain controller will elevate the permissions for Exchange Trusted Subsystem to domain administrators.
    For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.WarningInstallExchangeRolesOnDomainController.aspx
    Looks like I have it sorted out.
    Thanks

  • Exchange Server not working with Mac mail

    Any tips on how exchange can work work with mac mail? I get connection errors.

    Hello Phil.
    Copied from Mail Help.
    An Exchange account allows you to connect to your Exchange server via IMAP, and if you enter text in the Outlook Web Access Server field, Mail filters non-email related content from the server. (You can get the text you need to enter from your mail account provider.) For Exchange to work with Mail, Exchange administrators need to configure the Exchange server for IMAP access. Some system administrators may refer to an Outlook Web Access Server as an Internet Information Services (IIS) server.
    Is the Exchange Server configured for IMAP access?

  • How to access JDBC Resource registered in Sun Java System App Server ?

    I want to create a stand-alone JDBC application with Java SE using Swing technologies and JNDI technology. The purpose of using JNDI technology is to avoid change of Java Source Code every time I move the database to different location. This Java application will be used in a standalone PC installed with Windows XP Professional with no LAN / WAN connection. Of course, Internet connection is available with the PC.
    I use JavaDB to store the data tables and the location of the database is D:\E-DRIVE\SAPDEV. Tomorrow, if I move this database to C:\SAPDEV or any network drive, I do not want to change the Java Source code. I want to use JNDI which, if I am not wrong, helps developers to avoid manual change of Java source code whenever the database location is changed. Changes have to be made only in the JNDI Name which contains all relevant information about the database in order to get connection no matter where the database SAPDEV is stored; it can be placed under D:\E-DRIVE directory or C:\ directory of the hard disk. To implement my intention, I started developing Java application as per the steps mentioned below:
    Step 1:
    To proceed, first, I sought the help of Sun Java System Application Server Admin Console. I created JNDI object for Connection Pool using the menu path Common Tasks->Resources->JDBC->Connection Pools.
    JNDI Name : ABAPRPY
    Resource Type : javax.sql.DataSource
    Datasource class : org.apache.derby.jdbc.ClientDataSource
    Description : ABAP Program Repository
    The Connection Pool creation has options for General, Advanced and Additional Settings tabs and I made all the settings relevant to the database I created in D:\E-DRIVE\SAPDEV.
    To confirm whether the above settings are correct, I pressed the Ping push button which is available in the General tab of the connection pool creation screen. The system responded with the message Ping Succeeded.
    Step 2:
    I created a JDBC Resource using the menu path Common Tasks->Resources->JDBC->JDBC Resources.
    JNDI Name : jdbc/SAPDEV
    Pool Name : ABAPRPY
    Description : Database Connection for SAPDEV database
    Status : Enabled
    I can see all the above settings recorded in the domain.xml which is placed in the folder
    C:\Sun\AppServer\domains\domain1\config
    Step 3:
    I have made sure that Sun Java System Application Server is up and running in the background with JavaDB server. I created a Java Program making sure the following JAR files are included in the classpath:
    appserv-admin.jar
    appserv-ee.jar
    appserv-rt.jar
    javaee.jar
    fscontext.jar
    Plus, the lib directory of JDK 1.6 & C:\Sun\AppServer\domains\domain1\config
    Source code of the program is as follows: I used NetBeans IDE to create my project file.
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.naming.*;
    import javax.activation.DataSource;
    public class JNDILookup {
    public static void main(String[] args) {
    try {
    InitialContext initCtx = new InitialContext();
    DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/sapdev>");
    } catch (NamingException ex) {
    Logger.getLogger(JNDILookup.class.getName()).log(Level.SEVERE, null, ex);
    When I attempted to compile the above program in NetBeans IDE ,no compilation error reported. But while executing the program, I got the following run-time error message:
    SEVERE: null
    javax.naming.NameNotFoundException: No object bound for java:comp/env/jdbc/sapdev> [Root exception is java.lang.NullPointerException]
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:224)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at SAPConnect.JNDILookup.main(JNDILookup.java:21)
    Caused by: java.lang.NullPointerException
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
    ... 3 more
    Now, I want to come out of this situation; at the same time, I want to preserve the settings I have made in the Sun Java System Application Server Admin Console. That is, I want to programmatically access the data source using Connection Pool created in Sun Java System Application Server Admin Console.
    I request dear forum members to provide me an appropriate solution.
    Thanks and regards,
    K. Rangarajan.

    jay44 wrote:
    Bare in mind I am attempting the context.lookup() from inside the container (my code is in a session bean). I have accessed the server and have my bean "say hello" first to verify the bean works OK, then I call a method with this rather standard code:
    String jndiDataSourceName ="Second_EJB_Module_DataBase";
    Logger.getLogger(DynamicPU.class.getName()).log(Level.INFO,"Programatically acquiring JNDI DataDource: "+ jndiDataSourceName);
    InitialContext ctx;
    try {
    ctx = new InitialContext();
    ds =(DataSource)ctx.lookup("java:comp/env/jdbc/"+jndiDataSourceName);
    } catch (NamingException ex) {
    Logger.getLogger(DynamicPU.class.getName()).log(Level.SEVERE, null, ex);
    return "Exception generated trying to preform JDBC DataSource lookup. \n"+ex.toString();
    But when I run the code the server log shows the initial context is created Ok, but an exception is thrown becasue the resource name is not found:
    (and i have tried vriations of ctx.lookup("jdbc/"+jndiDataSourceName) etc etc
    You are fine here. It works in container because the InitialContext properties have been supplied already. That was the link I forwarded earlier. The InitialContext you create locally needs to locate the container JNDI. That is what the properties specify.
    Where I am confused is where you indicate the stack below is from the server log. So, you initiate a standalone (java main method) application, create an InitialContext, and you see the results in your app server log?
    LDR5010: All ejb(s) of [EJB_Module_1] loaded successfully!
    Programatically acquiring JNDI DataDource: Second_EJB_Module_DataBase
    The log message is null.
    javax.naming.NameNotFoundException: Second_EJB_Module_DataBase not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:192)...
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    This is strange since I can see this resource (a JDBC connection named Second_EJB_Module_DataBase) is configured on the server from the server's admin console.
    That is why you can obtain a lookup from within the container (app server).
    For this lookup to work it may be that one must map the name inside an ejb-jar.xml deployed with the application, but I have also read some resources like jdbc connection should have a default name. Does anyone know if my lookup() should work without using an ejb-jar.xml mfile to explcitly map the reource for my application?
    Both EBJ's and data sources can be referenced via JNDI. It's a remote lookup (that is normally optimized if it is running in the same JVM). You should not have any dependencies on a JDBC data source being set-up on ejb-jar.xml. That file can of course impact your EJB's. However, data sources are normally set-up on a container-specific basis (e.g., you probably did it through a console, but there is a spec somewhere about how to set up a data source via a resource the app server looks for; it varies from app server to app server). However, once you have that container-specific data source set-up, JNDI operates vendor-neutral. You should be able to take the code above and move it to JBoss or Weblogic or Tomcat or whatever (this is an ideal, in practice, the vendors sometimes put a data source in a name you would not expect, but again, you can use their JMX console to see what the JNDI name is).
    (As I stated above if I have to use a deployment discriptor to get at this JNDI datasource, then solution is not "programmatic" as newly configured datasources could not be accessed without redeploying the entire application).
    As JSchell alluded to, you will always have at least something vendor-specific. JNDI itself (the code you wrote) is totally portable. However, you have to set the various JNDI environment properties to a given vendor's spec. Ideally, you should not need a vendor's actual InitialContext application, but it's a possibility. Once you can safely cast to Context, you should be vendor-neutral (if not, demand your money back).
    So that is exactly where I am stuck, trying to get the lookup to work and wondering if it should work without and xml file mapping the resource for my app.
    What we ended up doing for standalone was to provide our own JNDI. If you look at the open source project JOTM, there are examples on how to use that with XBean (if integrating with Spring, as we did), you can easily set up a data source that runs standalone exactly as you get in the container. Another benefit is you get full JTA/JTS support and the ability to run XA transactions. (This might all be alphabet soup, but the app server gives it to you, and this is the way we ended up doing the same: JNDI + JTA + JTS + XA). It ends up the same application code uses a "vanilla" InitialContext and all we have to do is write one or two xml files (one for our app server, a couple for JOTM), and our actual code works the same.
    I still think you have a shot at getting to the container's JNDI, just not using their full-blown app server JAR.
    I think there must be a simple way to do this with an ejb-jar.xml, I am no expert in JNDI, I could be missing something simple, I will keep at it and post an answer here if I come up with it.
    Thanks, jayIt is simple to code. Getting it to integrate with your app server, yes, that can be challenging. But it has nothing to do with EJB's. Write a simple test. Using nothing but DataSource and InitialContext. Let us know where you get stuck.
    - Saish

Maybe you are looking for

  • Accrual Engine

    Dear All; i need help when posting the periodic Accrual run of the manual accrual; the scenario is: i transfer the vendor invoices to the accrual engine automatically via the report ACAC_DATA_TRANSFER_EXAMPLE & the Vendor invoices transferred success

  • Printing book to a PDF

    My goal is to create a PDF with the high-res photos from the book. I click the Print... button and choose the option to save to PDF. However, the PDF does not contain the high-res versions of the photos. The images in the book are referenced from ano

  • Please help me tO delete phOtO stream in iclOud

    I want tO del phOtO stream by my iPhone 4. I don't have ne Other device like computer tO dO this!!when I sign in my I'd nO OptiOn is cOming fOr reset phOto stream Or setting!!! Plz I need help tO cOme Out this headache !! With best Regards!!

  • Convert to AppleTV, no audio

    I have some video clips recorded on my digital camera in mpg which I am able to play in both iTunes and Quick Time but not on the apple tv. I have just bought Quick Time Pro to be able to convert the files to the apple tv format. But when I do so the

  • Query to connect Java Applet to Oracle 10g.

    I am developing an Applet in Java 1.5.0.7.My database is Oracle 10g.Now when i connect Oracle to Java I get the Error : java.lang.ExceptionInInitializerError and it does not get connected.Please help me anyone. Below is the code which i have written.