cancel
Showing results for 
Search instead for 
Did you mean: 

[Portal 7.3] access modifier in com.sapportals.wcm.repository.IResource

Former Member
0 Kudos

Hello everyone!

After portal update from 7.0 version to 7.3 stoped working with error:


Error: Application error occurred during the request processing.
Error Type: [com.sap.ASJ.web.000137]

Details: java.lang.NoSuchMethodError: com.sapportals.wcm.repository.IResource.getLinkType()Lcom/sapportals/wcm/repository/enum/LinkType;
	at pl.com.bcc.flexibleui.renderer.HomepageCollectionRenderer.renderUI(HomepageCollectionRenderer.java:177)

line that couses a problem:


String link_type = res_child.getLinkType().toString();

Now, the only difference between class IResource in 7.0 and 7.3 are access modifiers:


7.0:
public LinkType getLinkType()
7.3:
LinkType getLinkType()

what makes method getLinkType() inaccessible from outside the package.

I though of a workaround to compile my classes as a part of package com.sapportals.wcm.repository, but I'm affraid it wouldn't follow the best programming practices. Besides I cannot find com.sapportals.wcm.repository in portal 7.3 resources (why?) to compile.

Dear experts, do you have any ideas of how to solve that issue?

Guesses why even SAP decided to change access modifiers?

Thanks a lot,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Daniel,

The problem you are confronted with is the signature of the method, and in this case that is the return type:

java.lang.NoSuchMethodError: com.sapportals.wcm.repository.IResource.getLinkType()Lcom/sapportals/wcm/repository/enum/LinkType;

That is correct, but has nothing to do with the access modifier: The return type in 7.3 is

com.sapportals.wcm.repository.enums.LinkType

whereas it has been until 7.0:

com.sapportals.wcm.repository.enum.LinkType

That is due to being "enum" a key word from Java 5 on.

That's all, so the change to be done is just extending an "s" in the corresponding import statement

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev!

Thank you for your quick reaction and helpful answer.

Still, I cannot find particular libs for the project to be compiled.

Even though I use Jar/Class locator, nothing is found for com.sapportals.wcm.*

sapjarfinder.com won't help, because it works with 7.0 libs only.

Will be grateful for any ideas!

Thanks,

Daniel

detlev_beutner
Active Contributor
0 Kudos

Hi Daniel,

The problem with the current ClassLocator is that it does not index JAR files with an "~" in it's name (would be great if someone would fix this one day...; at least I just filed a short bug report).

An alternative for example might be using WinRAR; of course, it's much less comfortable than CL, but at least it brings you to your aim.

On the other side, the KM jars don't seem to be affected by this bug. With a classpath variable APPS_SAP_COM set to"/usr/sap/<SID>/<INST>/j2ee/cluster/apps/sap.com", the following classpath entries cover some KM things for example:

APPS_SAP_COM/com.sap.km.cm.ui/servlet_jsp/com.sap.km.cm.ui/root/WEB-INF/lib/km.shared.ui.enum_api.jar
APPS_SAP_COM/com.sap.km.cm.ui.flex/servlet_jsp/com.sap.km.cm.ui.flex/root/WEB-INF/lib/km.shared.ui.flex.base_api.jar
APPS_SAP_COM/com.sap.netweaver.bc.crt/servlet_jsp/com.sap.netweaver.bc.crt/root/WEB-INF/lib/bc.crt_api.jar
APPS_SAP_COM/com.sap.netweaver.bc.rf/servlet_jsp/com.sap.netweaver.bc.rf/root/WEB-INF/lib/bc.rf.framework_api.jar
etc pp

So in your case it seems more probable that you did not use the right root directories for letting CL index all relevant stuff.

It should be, with corresponding classpath variables:

"/usr/sap/<SID>/<INST>/j2ee/cluster/apps/sap.com" [APPS_SAP_COM]
"/usr/sap/<SID>/<INST>/j2ee/cluster/bin/services" [BIN_SERVICES]
"/usr/sap/<SID>/<INST>/j2ee/cluster/bin/ext" [BIN_EXT]

Of course, you are not obliged to use the classpath variables, or if you use some you might use different name. Anyhow, it makes much sense to use them as well as to use these names...

Hope it helps

Detlev

Former Member
0 Kudos

Dear Detlev,

Thank you so much again!

Unfortunately I'm not able to add all of these locations to CF properties, since portal is installed on separate server in separate network. Machine I use to browse server files is pretty weak, has no WinRAR, no NWDS, what makes searching for an exact class a big logistic problem.

Coping all jars crashes system :).

I'm looking for classes:


import com.sapportals.wcm.WcmException;
import com.sapportals.wcm.rendering.base.ILayoutObject;
import com.sapportals.wcm.rendering.collection.LightCollectionRenderer;
import com.sapportals.wcm.repository.ResourcePropertyComparator;
import com.sapportals.wcm.repository.service.layout.customizing.ICollectionRendererParameterNameConst;
import com.sapportals.wcm.repository.service.layout.customizing.IParameterName;
import com.sapportals.wcm.repository.service.layout.customizing.IParameters;
import com.sapportals.wcm.repository.service.layout.customizing.IResourceRendererParameterNameConst;
import com.sapportals.wcm.service.propertyconfig.IMetaName;
import com.sapportals.wcm.service.propertyconfig.IMetaNameList;
import com.sapportals.wcm.service.propertyconfig.IPropertyConfigurationService;

and


import com.sapportals.wcm.WcmException;
import com.sapportals.wcm.control.util.URLGeneratorHelper;
import com.sapportals.wcm.rendering.base.ILayoutObject;
import com.sapportals.wcm.rendering.collection.LightCollectionRenderer;
import com.sapportals.wcm.rendering.readymades.ResourceLink;
import com.sapportals.wcm.rendering.util.EmptyHtmlFragment;
import com.sapportals.wcm.repository.IProperty;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.IResourceList;
import com.sapportals.wcm.repository.PropertyName;
import com.sapportals.wcm.repository.ResourceException;

If you would be able to point files containing what we need here, problem shall be solved.

Best regards,

Daniel

detlev_beutner
Active Contributor
0 Kudos

Hi Daniel,

> Coping all jars crashes system :).

?!?! I will now provide the list of references you need, BUT: You cannot be serious that you always need a guy on SDN to tell you which JAR to reference... Someone who develops against the portal definitely needs the JARs (or even better a full copy of the directories listed in my last answer) on the local dev machine!!!

Anyhow, here you are, but only this once. Get your bosses to understand which infrastructure is needed for a portal developer...

<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.ui/servlet_jsp/com.sap.km.cm.ui/root/WEB-INF/lib/km.shared.ui.util_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.netweaver.bc.util/servlet_jsp/com.sap.netweaver.bc.util/root/WEB-INF/lib/bc.util.public_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.ui.flex/servlet_jsp/com.sap.km.cm.ui.flex/root/WEB-INF/lib/km.shared.ui.flex.base_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.ui.flex/servlet_jsp/com.sap.km.cm.ui.flex/root/WEB-INF/lib/km.shared.ui.flex.collection_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.ui.flex/servlet_jsp/com.sap.km.cm.ui.flex/root/WEB-INF/lib/km.shared.ui.flex.util_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.ui.flex/servlet_jsp/com.sap.km.cm.ui.flex/root/WEB-INF/lib/km.shared.ui.flex.readymades_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.netweaver.bc.rf/servlet_jsp/com.sap.netweaver.bc.rf/root/WEB-INF/lib/bc.rf.framework_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.repository.service.base/servlet_jsp/com.sap.km.cm.repository.service.base/root/WEB-INF/lib/km.shared.repository.service.layout_api.jar"/>
<classpathentry kind="var" path="APPS_SAP_COM/com.sap.km.cm.service.base/servlet_jsp/com.sap.km.cm.service.base/root/WEB-INF/lib/km.shared.service.propertyconfig_api.jar"/>

From my last answers, you'll understand APPS_SAP_COM.

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev,

You're right, I wouldn't be serious asking for that all the time, therefor thank you very much that you've decided exceptionally to help me.

All my doubts were resolved, so I consider thread as closed.

Former Member
0 Kudos

Hi Detlev,

I have a WD DC 7.3, and I got a error caused by:

"import com.sapportals.wcm.repository.enum.PropertyType;"

I know the correct import is "com.sapportals.wcm.repository.enums.PropertyType", but I don't have  "bc.rf.framework_api.jar" and "bc.util.public_api.jar".

In my sever 7.3 I don't find these jars in the path ""/usr/sap/<SID>/<INST>/j2ee/cluster/apps/sap.com/".

Can you help me? Or send me jar files?

Regards

Former Member
0 Kudos

Hi Jim,

Contact my mail, so I could send you those jars.

d

Former Member
0 Kudos

Hi Daniel.

It's all ok!

Thank you very much! I'm very grateful.

Regards!

Answers (0)