on 01-17-2006 2:13 PM
Hi I am trying to use KM API in servlet .
I am not sure what library to mention in references in
application-j2ee-engine.xml in EAR.
Code is as follows .
Code is printing out.print(ume4User.getFirstName());
if remaining section of code is not there . Otherwise its throwing ....
Application error occurred during request processing.
Details: java.lang.NoClassDefFoundError: com/sapportals/wcm/crt/CrtClassLoaderRegistry The ID of this error is
Exception id: [000C29882910004F0000000C000013E800040A8E05AA8CB7].
PrintWriter out = response.getWriter();
out.print("Lakshmi");
com.sap.security.api.IUserFactory iFactory=UMFactory.getUserFactory();
com.sap.security.api.IUser ume4User = null;
try {
ume4User = iFactory.getUserByLogonID("administrator");
out.print(ume4User.getFirstName());
} catch (Exception e) {
// TODO Auto-generated catch block
out.print(e.getMessage());
}
com.sapportals.portal.security.usermanagement.IUser ep5User = null;
try {
ep5User = WPUMFactory.getUserFactory().getUser("administrator");
} catch (Exception e1) {
// TODO Auto-generated catch block
out.print(e1.getMessage());
}
IResourceContext resourceContext = new ResourceContext(ep5User);
RID rid = RID.getRID("/documents");
IResource resource = null;
try {
resource =
ResourceFactory.getInstance().getResource(
rid,
resourceContext);
response.getWriter().println(resource.getName());
} catch (Exception e2) {
// TODO Auto-generated catch block
out.print(e2.getMessage());
}
hello kaushik,
what's your EP version as well as SP level?
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello kaushik,
please refer to this page for your references in the
application descriptor.
http://help.sap.com/saphelp_nw04s/helpdata/en/42/beba2f734921e3e10000000a114cbd/content.htm
regards
jo
TRy this with application-j2ee-engine.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE application-j2ee-engine SYSTEM 'application-j2ee-engine.dtd'>
<application-j2ee-engine>
<reference reference-type="weak">
<reference-target provider-name="sap.com" target-type="library">oracle</reference-target>
</reference>
<classpath>c:/lib/XYZ.jar</classpath>
<fail-over-enable mode="disable"/>
</application-j2ee-engine>
Here I have given two example one is direct ref to a jar file called XYZ.jar
another if you have created a libarary using Visual Admin Tool & u wanted to establish a relationship between the ur application and this library called "oracle"
I guess you can do the first approach, In such case you don't need to bundle XYZ jar as part ur ear file, This will do the trick.
One more thing please remove the application manually using Visual Admin tool before deploying using this descriptor
It works by this .
To Talk to KM we need
<application-j2ee-engine>
<reference
reference-type="weak">
<reference-target
provider-name="sap.com"
target-type="application">com.sap.km.application</reference-target>
</reference>
<provider-name>sap.com</provider-name>
<fail-over-enable
mode="disable"/>
</application-j2ee-engine>
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.