on 01-11-2006 4:35 AM
Hi,
I am trying to write a session bean that accesses the KM.
Normally when we access the KM thorough a portal component or web dynpro we can put a sharing reference to the KM in the portalapp.xml.
How do I refer to the KM from within an EJB. I have inlcluded all the KM jar files in my project, but still I am facing problems.
My Code is as follows.
SessionBean
IUser ep5User = WPUMFactory().getUserFactory().getEP5User(user);
IResourceContext ctx = new ResourceContext(ep5User);
RID rid = RID.getRID("/documents/supply_files");
IResource = ResourceFactory.getInstance().getResource(rid, ctx);
Now this code works fine from a PortalComponent and Web DynPro. But when I try it from an EJB I get the following error.
Cannot get Usermanagement Factory class: java.lang.ClassNotFoundException:
com.sapportals.portal.security.usermanagement.UMFactory
-
Loader Info -
ClassLoader name: [sap.com/KMDocumentTreeEAR]
Parent loader name: [Frame ClassLoader]
References:
common:service:http;service:servlet_jsp
service:ejb
common:service:iiop;service:naming;service:p4;service:ts
service:jmsconnector
library:jsse
library:servlet
common:library:IAIKSecurity;library:activation;library:mail;library:tcsecs
sl
library:ejb20
library:j2eeca
library:jms
library:opensql
common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;li
brary:security.class;library:webservices_lib;service:adminadapter;service:ba
sicadmin;service:com.sap.security.core.ume.service;service:configuration;ser
vice:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notific
ation;service:keystore;service:security;service:userstore
interface:resourcecontext_api
interface:webservices
interface:ejbserialization
Any Help is greatly appriciated.
Hi,
did you specify a reference to the JAR file that contains the com.sapportals.portal.security.usermanagement.UMFactory class (as well as all other libs that your EJB refers to) in the application-j2ee-engine.xml in your KMDocumentTreeEAR?
The reference in this XML is used in runtime to set references between the classloader of your application (EAR) and the classloaders of the libs used by the application.
Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add the following reference to application-j2ee-engine.xml
<reference reference-type="weak">
<reference-target
provider-name="sap.com"
target-type="application">com.sap.km.application</reference-target>
</reference>
Cheers,
Deyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deyan
I have an EJB inside an EAR trying to access KM, do i have to add this reference to the ejb-j2ee-engine.xml?
This is my ejb-j2ee-engine.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>KmmsListEJBBean</ejb-name>
<session-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
Thanks in advance Deyan
Did you ever solve this problem? I'm facing the same issue..
Thank you,
Fallon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You clearly miss a lib. Find out which libs you are using in your portal component and add them to the EJB project also. In case of EJB projects, there is no automatic including of portal libs as may be in portal projects. That's your problem.(hopefully)
Regards,
Benny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
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.