cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access Datasource Using JNDI reference

Former Member
0 Kudos

Hi Guys,

There are few questions that i want to know.

1. How do we configure datasources so that they can be referenced via thier JNDI names.

2. What is the ejb compiler available in netweaver.

3. Where to find the log files for system.out.println messages.

Thanks ,

Mukul

View Entire Topic
iavor_petkov
Explorer
0 Kudos

Hi Mukul,

1. In order to have a datasource you need to have deployed the JDBC driver for it first. To do so check

http://help.sap.com/saphelp_nw70/helpdata/EN/80/4f34c587f05048adee640f4c346417/frameset.htm

Then you can deploy the datasource as part of your application as described here:

http://help.sap.com/saphelp_nw70/helpdata/EN/bb/69da54d8aedc419d46d9ea074e4d41/frameset.htm

If you choose to define it in a separate application, you must make sure you define hard reference in the application-j2ee-engine.xml from the application that uses the datasource to the application that provides it.

2. The generated EJB files are compiled using internal compiler by default with a fallback to javac.

3. The logging of messages to System.out is a practice that is generally discouraged, since you cannot easily locate the party that floods the traces/fills-up the file system etc. Therefore SAP recommends using the SAP Logging API or the alternatively bridging the log4j/commons logging to SAP Logging API.

If you would still prefer to use System.out for quick&dirty troubleshooting, then you only need to change the severity of location System.out from the default ERROR to INFO. Then the statements emitted to System.out will be logged in the default trace. The change is typically performed using the Log Configurator service in the Visual Administrator (on the server node) but SAP provides the options to do the same with telnet shell, Configtool and NWA as well.

Same goes with System.err .

I hope the above helps a bit.

Best Regards,

Iavor

Former Member
0 Kudos

Hi Iavor,

Thanks for the reply.

Is it possible to grab some of the external jars from netweaver server and compile the EJB's externally?

Mukul.

iavor_petkov
Explorer
0 Kudos

Hi Mukul,

You could in principle take the client jars for the EJBs and compile clients for the EJBs (later to be accessed via RMI) - for this you would need a subset of the files in <j2ee>/j2eeclient directory. For the most basic things you need sapj2eeclient.jar;exception.jar;logging.jar.

However I believe you cannot generate the EJB stubs & skeletons for remote and local home as well as enhance the bean implementation class outside the server environment.

At least I do not know exposed public API for this purpose and I would expect even if such existed, the classpath would be huge due to all the dependencies.

Maybe there is more elegant solution, I am not sure about the actual use case.

Best Regards,

Iavor

Former Member
0 Kudos

Hi Iavor,

Thanks for the quick response. The answers have been very helpful so far

Few more questions

1. Can we maintain two ear's with the same Web context?

Lets Suppose :

EAR1 has a WebApplication1 inside it.

EAR2 has a WebApplicvation2 inside it.

Can we have these two EAR's co-existing so that i can access

http://localhost:50000/WebApplication1/WebApplication2

2. How to Configure JAAS for LDAP authetication?

3. Can we configure IPlanet LDAP as part of our ear deployment instead of doing it manually in the IRJ Portal.

4. Does netweaver provide any startup and shutdown classes (like we have in weblogic) ? Some actions need to done prior to the starting of the netweaver server and post shutdown.Does netweaver provide any class or service to accomplish this?

Thanks,

Mukul.

Edited by: Mukul Mangla on Feb 17, 2009 12:07 PM

Edited by: Mukul Mangla on Feb 17, 2009 2:16 PM

iavor_petkov
Explorer
0 Kudos

Hi Mukul,

About 2 and 3 - unfortunately I do not know. It would probably be better to post these as separate questions, so that security Gurus spot them.

4. Unfortunately the Engine does not have a startup or shutdown class functionality. You could bundle start and stop actions related to an application in the init and destroy method of a servlet that has load-on-startup set in the web.xml.

1. It might be possible in some versions but it should be considered a bug and should not be relied upon.

According to the spec, Web aliases of applications should be unique. You could easily extend this to subaliases as well.

For example if EAR1 defines the Web Alias WebApplication1 and you could access it as http://localhost:50000/WebApplication1 while EAR2 defines the Web Alias WebApplication2 and you could access it as http://localhost:50000/WebApplication2

You would basically like to have the content of http://localhost:50000/WebApplication2 inside http://localhost:50000/WebApplication1/WebApplication2.

But for the Engine these are two different applications and you could do anything with them, including registering a servlet as part of EAR1 (and the war of WebApplication1) that listens for subcontext /WebApplication2 of the root context (WebApplication1).

If you had some kind of static mapping , which one of the resources should the Engine return on request to

http://localhost:50000/WebApplication1/WebApplication2 ?

Is it the newly defined servlet or is it the static mapping to EAR2 ?

Therefore for handling this case I would recommend defining a servlet inside WebApplication1 that includes the content of WebApplication2 and presents it to browsers (or redirects to WebApplication2 as an alternative for direct communication).

Best Regards,

Iavor

Former Member
0 Kudos

Hi Iavor,

Thanks for the reply. I am having issue in deploying entity beans to netweaver server.

When we deployed the CMP to netweaver CE 7.0 it deployed successfully now when we are tryin to migrate the code to CE 7.1 it is throwing an expection during the publish. " findbyprimary key is not found in one of the interfaces is null"

Can you help me in resolving this Iavor?