Skip to Content

Looking for a good source on custom actions in MII 14.x

Hi,

I am writing, or rather have written, a piece of java code for a custom action block.
When writing the code in standard Java it works, thus I started changing to code to make it usable for a custom action block on MII.

To do this I used "SAP PRESS - Implementing and configuring SAP MII" Chapter 9.1. This is based on an earlier version of MII and I have noticed some differences with the current version.
So I was wondering if the steps for creating a custom action and deploying it have changed. When I try to deploy my action I get a lot of errors which I did not expect.

My action has to take 3 input parameters and should give one string as output (just to give a reference that it ain't a complex action).

Could anyone provide me a code template or point me to some up to date documentation on creating custom actions in MII?

With kind regards,

Joery

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 26, 2013 at 08:05 AM

    Hi Joery,

    Is the Catalog.xml added to the root folder of your jar? (The classes inside the jar can be in nested folder structure).

    -

    Rutika



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 25, 2013 at 06:39 PM

    Joery, Did you use right JVM to build your class files ? You need to use same JVM which MII server uses .

    Hope this helps.

    Thanks

    Hari

    Add comment
    10|10000 characters needed characters exceeded

    • It seems I did not, the MII server only has 1.6 and I was using 1.7 on my dev machine.
      Changed it now, but the errors remain.
      It is as if the class itself cannot be found in the jar file. Do all files in the jar file need to be in the top level or can they be in a folder, for instance in my case the class file is in a folder "bin" which is also pointed to in the catalog.xml.

      Just in case it might help I will add the error log. Sorry for the wall of text it causes.

      error Creating Component : contactScale/bin/contactScale.class : bin/contactScale.class

      [EXCEPTION]

      java.lang.ClassNotFoundException: bin/contactScale.class

      at com.sap.lhcommon.system.CustomClassLoader.findClass(CustomClassLoader.java:232)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:367)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:308)

      at com.sap.xmii.xacute.components.ComponentCatalogManager.getActionInstance(ComponentCatalogManager.java:767)

      at com.sap.xmii.xacute.components.ActionComponent.createInstance(ActionComponent.java:198)

      at com.sap.xmii.xacute.components.ComponentCatalogManager.postProcessCustomAssemblyList(ComponentCatalogManager.java:630)

      at com.sap.xmii.xacute.components.ComponentCatalogManager.access$100(ComponentCatalogManager.java:69)

      at com.sap.xmii.xacute.components.ComponentCatalogManager$JarReaderCustomizer.customize(ComponentCatalogManager.java:1563)

      at com.sap.xmii.dao.reader.DatabaseObjectReader.getObjects(DatabaseObjectReader.java:98)

      at com.sap.xmii.xacute.components.ComponentCatalogManager.getCustomAssemblyList(ComponentCatalogManager.java:593)

      at com.sap.xmii.ejb.sysres.CustomActionsServiceBean.getCustomAssemblyList(CustomActionsServiceBean.java:49)

      at sun.reflect.GeneratedMethodAccessor401785.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext$InvocationContextImpl.proceed(AbstractInvocationContext.java:131)

      at com.sap.xmii.ejb.common.AdministrationInterceptor.wrapRuntimeExceptions(AdministrationInterceptor.java:50)

      at com.sap.xmii.ejb.common.AdministrationInterceptor.assertHasPermission(AdministrationInterceptor.java:38)

      at sun.reflect.GeneratedMethodAccessor2912.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Application.invoke(Interceptors_Application.java:53)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)

      at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)

      at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)

      at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164)

      at $Proxy399.getCustomAssemblyList(Unknown Source)

      at com.sap.xapps.xmii.ui.admin.sysres.sysrescomp.CustomActionsComp$JarInfoProvider.getObjectList(CustomActionsComp.java:449)

      at com.sap.xapps.xmii.ui.admin.common.table.TableController.requestObjectList(TableController.java:319)

      at com.sap.xapps.xmii.ui.admin.common.table.ObservableObjectList.updateCache(ObservableObjectList.java:122)

      at com.sap.xapps.xmii.ui.admin.common.table.ObservableObjectList.size(ObservableObjectList.java:110)

      at com.sap.tc.webdynpro.progmodel.context.ModelElementList.size(ElementList.java:1776)

      at com.sap.tc.webdynpro.progmodel.context.Node.size(Node.java:543)

      at com.sap.xapps.xmii.ui.admin.sysres.sysrescomp.CustomActionsComp.refreshContext(CustomActionsComp.java:202)

      at com.sap.xapps.xmii.ui.admin.sysres.sysrescomp.wdp.InternalCustomActionsComp.refreshContext(InternalCustomActionsComp.java:215)

      at com.sap.xapps.xmii.ui.admin.sysres.sysrescomp.CustomActionsView.okDeployAction(CustomActionsView.java:653)

      at com.sap.xapps.xmii.ui.admin.sysres.sysrescomp.wdp.InternalCustomActionsView.wdInvokeEventHandler(InternalCustomActionsView.java:443)

      at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:142)

      at com.sap.tc.webdynpro.clientserver.event.CustomEventProcessor.handleServerEvent(CustomEventProcessor.java:46)

      at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.doHandleServiceEvent(ProcessingEventPhase.java:207)

      at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.execute(ProcessingEventPhase.java:96)

      at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequestPartly(WindowPhaseModel.java:162)

      at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doProcessRequest(WindowPhaseModel.java:110)

      at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseLoop(WindowPhaseModel.java:101)

      at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processPhaseLoop(WebDynproWindow.java:548)

      at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.handleWindowHierarchyChanges(AbstractClient.java:111)

      at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

      at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doExecute(ClientApplication.java:1671)

      at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doProcessing(ClientApplication.java:1485)

      at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessingStandalone(ApplicationSession.java:908)

      at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessing(ApplicationSession.java:880)

      at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:357)

      at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:326)

      at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doContent(AbstractDispatcherServlet.java:87)

      at com.sap.tc.webdynpro.serverimpl.wdc.DispatcherServlet.doContent(DispatcherServlet.java:89)

      at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doPost(AbstractDispatcherServlet.java:62)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)

      at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:367)

      at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:490)

      at com.sap.tc.webdynpro.serverimpl.wdc.ForwardServlet.doPost(ForwardServlet.java:63)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)

      at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)

      at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:457)

      at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:210)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:441)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:430)

      at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:81)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:278)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)

      at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)

      at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)

      at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)

      at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)

      at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)

      at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)

      at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

      at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

      at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:475)

      at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:269)

      at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)

      at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)

      at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)

      at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)