on 07-16-2008 7:34 AM
Hi All,
I am using SAP NetWeaver Developer Studio to create a J2EE Application, which requires accessing user information from SAP coming from Windows Active Directory.
My question is as follows;
Is there a possibility in a J2EE application to use an API to obtain user information (ie. from com.sap.security.api.jar) just like in a regular WebDyn Pro Application?
For Archive Build Info (compile time), do I need to import specific JARs? For runtime, do I need to load any project reference?
Thanks in advance,
Michael
Hi Michael
It sounds like you're using a local project (i.e. not using NWDI). The recommended approach is to create a local DC containing your Java project.
Once this has been done, you can reference the tc/bl/security/lib DC in the ENGFACADE SC. This should give you access to the SAP security api. No need to add any jar references if you're using a DC project, as everything is done through SC references.
Your question sounds a little ambiguous to me, so I'm assuming you just want to access user data in the UME, rather than directly querying Active Directory using LDAP?
You can then add a reference to this library in your application-j2ee-engine.xml file (in the associated EAR project).
Just use the UMFactory class to get access to all the security info you need. Documentation can be found here: [http://help.sap.com/javadocs/nwce/current/se/SP5/index.html]
Let me know if you need further help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stuart,
Thanks a lot for your elaborate solution, it is working fine now.
Now I am trying to connect from my J2EE application to a MS SQL Server Database via JDBC.
I am not able to successfully connect, and am getting the following error:
"Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial"
The following code is used to get the connection:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/" + dataSourceName);
conn = ds.getConnection();
The exact same code is working fine within a Web DynPro project, so I don't think there is an issue with JDBC setup on the J2EE Web Server. Do you have any idea as to why I am unable to connect when using a J2EE Application instead?Am I missing something critical?
Thanks in advance,
Michael
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.