I have been working on eclipse for WS-BPEL processes. In a basic helloworld.bpel process, an assign block (which is between receiveInput and replyOutput blocks)requires input and output validation. But once I set input variable to input->payload->input and output to output->payload->result, I get this error
eObject cannot be null in getNamespaceMap()
Can anyone tell what this means and how I can deal with it?
Thanks
<!-- helloworld BPEL Process [Generated by the Eclipse BPEL Designer] -->
<bpel:process name="helloworld"
targetNamespace="http://helloworld"
suppressJoinFailure="yes"
xmlns:tns="http://helloworld"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
expressionLanguage="http://www.w3.org/TR/1999/REC-xpath-19991116">
<!-- Import the client WSDL -->
<bpel:import location="helloworldArtifacts.wsdl" namespace="http://helloworld"
importType="http://schemas.xmlsoap.org/wsdl/" />
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:helloworld"
myRole="helloworldProvider"
/>
</bpel:partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:helloworldRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:helloworldResponseMessage"/>
</bpel:variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in helloworld.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:helloworld"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from part="payload" variable="input">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[tns:input]]>
</bpel:query>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[tns:result]]>
</bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="replyOutput"
partnerLink="client"
portType="tns:helloworld"
operation="process"
variable="output"
/>
</bpel:sequence>
Related
I am trying to run IBM App ID on localhost. The App ID Login Widget is coming up. But after login it is not redirecting to my application. It is showing the login page again.
The same codebase is running on CF instance very well.
URL : https://us-south.appid.cloud.ibm.com/oauth/v4/xxxxxxx-62a9-4a02-8710-f421c59571a5/authorization?response_type=code&client_id=xxxxxxx-4c08-4f11-8370-181061306b65&state=001630038048040MsOwH2vS2&redirect_uri=https://localhost:9443/ne/oidcclient/redirect/MyRP&scope=openid+profile&language=en
Server.xml
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.3</feature>
<feature>localConnector-1.0</feature>
<!-- Features for APP ID -->
<feature>servlet-3.1</feature>
<feature>appSecurity-2.0</feature>
<feature>openidConnectClient-1.0</feature>
<feature>ssl-1.0</feature>
</featureManager>
<authFilter>
<requestUrl matchType="notContain" urlPattern="/getToken"/>
</authFilter>
<!-- To access this server from a remote client add a host attribute to the following
element, e.g. host="*" -->
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true" startTimeout="15m"/>
<webContainer extractHostHeaderPort="true" trustHostHeaderPort="true"/>
<applicationMonitor dropinsEnabled="false" updateTrigger="mbean"/>
<config updateTrigger="mbean"/>
<applicationMonitor updateTrigger="mbean"/>
<!--
<keyStore id="opTestKeyStore" location="\resources\security/mytruststore.jks" type="JKS"
password="keystorePwd" />
<openidConnectProvider id="OAuthConfigSample" oauthProviderRef="OAuthConfigSample"
signatureAlgorithm="RS256" keyStoreRef="opTestKeyStore" keyAliasName="myOpKeyAlias" />
-->
<keyStore id="defaultKeyStore" password="${keystore_password}"/>
<ssl id="oidcClientSSL" keyStoreRef="defaultKeyStore" trustDefaultCerts="true"/>
<openidConnectClient authFilterid="myAuthFilter"
authorizationEndpointUrl="${APP_ID_OAUTH_SERVER_URL}/authorization"
clientId="${APP_ID_CLIENT_ID}" clientSecret="${APP_ID_CLIENT_SECRET}" id="MyRP"
issuerIdentifier="${APP_ID_OAUTH_SERVER_URL}"
jwkEndpointUrl="${APP_ID_OAUTH_SERVER_URL}/publickeys"
redirectToRPHostAndPort="https://localhost:9443/ne/" signatureAlgorithm="RS256"
tokenEndpointAuthMethod="basic" tokenEndpointUrl="${APP_ID_OAUTH_SERVER_URL}/token"/>
<logging consoleLogLevel="INFO" logDirectory="${application.log.dir}"/>
<!-- <webApplication id="ne" location="ne-1.0.0-BUILD-SNAPSHOT.war" name="ne"/>-->
<webApplication id="ne" location="ne-1.0.0-BUILD-SNAPSHOT.war" name="ne"/>
</server>
I have a local Service Fabric cluster of 5 nodes and I have a problem deploying my application on all nodes. When set to "1 Node", the cluster works fine. When set to "5 Nodes" it gives an error on all nodes but one. This is the error/warning message:
Error event: SourceId='System.Hosting', Property='CodePackageActivation:Code:EntryPoint:131919316927686034'.
There was an error during CodePackage activation.System.Fabric.FabricException (-2147017731)
Failed to start Container. ContainerName=sf-0-28e0002f-fd7d-412c-81b8-b78ca5339ce4_865991cc-9c36-493f-9b3d-95f6eba43851, ApplicationId=Proton.SFType_App0, ApplicationName=fabric:/Proton.SF.
DockerRequest returned StatusCode=InternalServerError with ResponseBody={"message":"failed to create endpoint sf-0-28e0002f-fd7d-412c-81b8-b78ca5339ce4_865991cc-9c36-493f-9b3d-95f6eba43851 on network nat: HNS failed with error : You were not connected because a duplicate name
The error message looks truncated. The application loads up fine, but on one node only. Am I missing something in 5-node configuration? The application we are deploying is a container which runs a .NET Core app. I've attached a screenshot of the error in Service Fabric Explorer.
Error Screenshot
ServiceManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="Proton.TestingPkg"
Version="1.0.0"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceTypes>
<!-- This is the name of your ServiceType.
The UseImplicitHost attribute indicates this is a guest service. -->
<StatelessServiceType ServiceTypeName="Proton.TestingType" UseImplicitHost="true" />
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
<ContainerHost>
<ImageName>proton.azurecr.io/protontesting:latest</ImageName>
</ContainerHost>
</EntryPoint>
<!-- Pass environment variables to your container: -->
<!--
<EnvironmentVariables>
<EnvironmentVariable Name="VariableName" Value="VariableValue"/>
</EnvironmentVariables>
-->
</CodePackage>
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<Endpoint Name="Proton.TestingTypeEndpoint" Port="8001" />
</Endpoints>
</Resources>
</ServiceManifest>
ApplicationManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="Proton.SFType"
ApplicationTypeVersion="1.0.0"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Parameters>
<Parameter Name="Proton.Testing_InstanceCount" DefaultValue="-1" />
</Parameters>
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Proton.TestingPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<ContainerHostPolicies CodePackageRef="Code">
<!-- See https://aka.ms/I7z0p9 for how to encrypt your repository password -->
<RepositoryCredentials AccountName="ProtonCluster" Password="XXX" PasswordEncrypted="false" />
<PortBinding ContainerPort="80" EndpointRef="Proton.TestingTypeEndpoint" />
</ContainerHostPolicies>
</Policies>
</ServiceManifestImport>
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="Proton.Testing" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="Proton.TestingType" InstanceCount="[Proton.Testing_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
We are trying to develop custom Intershop Managed Service following cookbook: https://support.intershop.com/kb/index.php/Display/2329T4
But when trying to enable service in Operations for our Organization, it is not listed there and there is a warning log message:
WARN localhost ES1 appserver0 [Test-Site] com.intershop.component.service.internal.service.ORMServiceConfigurationBORepositoryImpl [] [Storefront] [8ocH1vmRUp4E1qKOZQQC5FFRtQai9r4QV6dAV1yx] [oBlLAFsfl5kFMqjA-0-00] "oBlLAFsfl5kFMqjA-0-00" Can't load implementation for service definition: cartridge='service_esb', service definition id='ESBServiceDefinition'.
Here is services.compoment:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010">
<!-- Adapter interface -->
<contract name="ESBService" class="com.test.service.capi.ESBService" />
<!-- ServiceDefintion implementation -->
<implementation name="ESBServiceDefinitionImpl" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />
<!-- ServiceDefintion instance that has already one adapter added -->
<instance name="ESBServiceDefinition" with="ESBServiceDefinitionImpl" />
<!-- Registering the ServiceDefintion instance to the (global) ServiceDefinitionRegistry -->
<fulfill requirement="serviceDefinition" of="serviceDefinitionRegistry">
<instance with="ServiceDefinitionRegistry.Entry">
<fulfill requirement="cartridgeID" value="service_esb" />
<fulfill requirement="groupID" value="service.group.name.test" />
<fulfill requirement="parameterGroupID" value="ESBParameters" />
<fulfill requirement="serviceDefinitionID" value="esbService" />
<fulfill requirement="localizationKeyForName" value="service.definition.name.esbService" />
<fulfill requirement="serviceDefinition" with="ESBServiceDefinition" />
<fulfill requirement="ChainElementID" value="LogHandler" />
<fulfill requirement="ChainElementID" value="MonitorHandler" />
</instance>
</fulfill>
</components>
All required classes (AdapterInterface, Adapter, ExecutorService, ServiceDefinition - extending AbstractServiceDefinition) are implemented and compiled successfully. Does anybody knows why Intershop can't load implementation?
Also, in Intershop Studio in component editor following error is displayed when services.component is opened:
With 'Implementation - ESBServiceDefinitionImpl (unresolved)' cannot be resolved
But when clicking CTRL+left mouse button on "ESBServiceDefinitionImpl" implementation is found and
<implementation name="ESBServiceDefinitionImpl" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />
is highlighted.
Of course it was typo :) I named folder with service.component "component", and not "components".
Thank you all for your help!
Maybe the ServiceDefinitionID does not match:
esbService vs. ESBServiceDefinition
Can you try the following component settings:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010" scope="global">
<!-- Adapter interface -->
<contract name="ESBService" class="com.test.service.capi.ESBService" />
<!-- ServiceDefintion implementation -->
<implementation name="com.test.service.internal.ESBServiceDefinition" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />
<!-- Registering the ServiceDefintion instance to the (global) ServiceDefinitionRegistry -->
<fulfill requirement="serviceDefinition" of="serviceDefinitionRegistry">
<instance with="ServiceDefinitionRegistry.Entry">
<fulfill requirement="cartridgeID" value="service_esb" />
<fulfill requirement="groupID" value="service.group.name.test" />
<fulfill requirement="parameterGroupID" value="ESBParameters" />
<fulfill requirement="serviceDefinitionID" value="esbService" />
<fulfill requirement="localizationKeyForName" value="service.definition.name.esbService" />
<fulfill requirement="serviceDefinition">
<instance with="com.test.service.internal.ESBServiceDefinition" />
</fulfill>
<fulfill requirement="ChainElementID" value="LogHandler" />
<fulfill requirement="ChainElementID" value="MonitorHandler" />
</instance>
</fulfill>
</components>
This is a long shot but did you try to redeploy the server after creating the custom managed service?
Stop the server.
Run gradlew deployServer
Start the server
I am new to BPEL and struggling to get started.
I created a simple If/Else workflow, but getting the following error when I am testing the wsdl file with eclipse web services explorer:
soapenv:Server axis2ns1:selectionFailure
My understanding from other similar questions is its probably something very simple and related to namespace or variable name in the if condition, but I can't understand why, and how to solve it.
I am using Apache ODE 1.3.7 on Eclipse 4.7.1 Oxygen and Tomcat 8.5.
This is my workflow design:
BPEL FILE:
<!-- Flow1 BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Mon Nov 13 23:18:38 AST 2017 -->
<bpel:process name="Flow1"
targetNamespace="http://Flow1"
suppressJoinFailure="yes"
xmlns:tns="http://Flow1"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
>
<!-- Import the client WSDL -->
<bpel:import location="Flow1Artifacts.wsdl" namespace="http://Flow1"
importType="http://schemas.xmlsoap.org/wsdl/" />
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:Flow1"
myRole="Flow1Provider"
/>
</bpel:partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:Flow1RequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:Flow1ResponseMessage"/>
</bpel:variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in Flow1.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:Flow1"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:if name="If">
<bpel:condition expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[$input.payload/tns:input="John"]]></bpel:condition>
<bpel:sequence name="Sequence">
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Hi John</bpel:literal>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="replyOutput" partnerLink="client" portType="tns:Flow1" operation="process" variable="output" />
</bpel:sequence>
<bpel:else>
<bpel:sequence name="Sequence1">
<bpel:assign validate="no" name="Assign1">
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Not john</bpel:literal>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="Reply" partnerLink="client" operation="process" portType="tns:Flow1" variable="output"></bpel:reply>
</bpel:sequence>
</bpel:else>
</bpel:if>
</bpel:sequence>
</bpel:process>
WSDL FILE:
<?xml version="1.0"?>
<definitions name="Flow1"
targetNamespace="http://Flow1"
xmlns:tns="http://Flow1"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<types>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://Flow1"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="Flow1Request">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="Flow1Response">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<message name="Flow1RequestMessage">
<part name="payload" element="tns:Flow1Request"/>
</message>
<message name="Flow1ResponseMessage">
<part name="payload" element="tns:Flow1Response"/>
</message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the Flow1 BPEL process -->
<portType name="Flow1">
<operation name="process">
<input message="tns:Flow1RequestMessage" />
<output message="tns:Flow1ResponseMessage"/>
</operation>
</portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="Flow1">
<plnk:role name="Flow1Provider" portType="tns:Flow1"/>
</plnk:partnerLinkType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BINDING DEFINITION - Defines the message format and protocol details
for a web service.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<binding name="Flow1Binding" type="tns:Flow1">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="process">
<soap:operation
soapAction="http://Flow1/process" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SERVICE DEFINITION - A service groups a set of ports into
a service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<service name="Flow1Service">
<port name="Flow1Port" binding="tns:Flow1Binding">
<soap:address location="http://localhost:8084/ode/processes/Flow1" />
</port>
</service>
</definitions>
and Deploy.xml
<?xml version="1.0" encoding="UTF-8"?>
<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:Flow1="http://Flow1">
<process name="Flow1:Flow1">
<active>true</active>
<retired>false</retired>
<process-events generate="all"/>
<provide partnerLink="client">
<service name="Flow1:Flow1Service" port="Flow1Port"/>
</provide>
</process>
</deploy>
SelectionFailure indicates that xml element that is being queried is not found. Looking at your BPEL, I assume the output variable is being queried before initializing it.
Initialize the output variable before the if/else:
<bpel:assign validate="no" name="initialize">
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">
<tns:Flow1Response xmlns:tns="http://Flow1"><tns:result /></tns:Flow1Response>
</bpel:literal>
</bpel:from>
<bpel:to part="payload" variable="output" />
</bpel:copy>
</bpel:assign>
Is there a way to override the /META-INF/spring/batch/servlet/manager/manager-context.xml in spring-batch-admin-manager? I would like to remove the home and files menu (which are standard menus). Please find attached the screenshot of the navigation menu bar below.
I tried to create a duplicate of the manager-context.xml under src/main/resources/META-INF/spring/batch/override folder of my webapp and comment out the following lines of code.
<bean class="org.springframework.batch.admin.web.HomeMenu" parent="baseMenu"/>
<bean class="org.springframework.batch.admin.web.FilesMenu" parent="baseMenu"/>
But, it creates duplicate menus as the original manager-context.xml in the spring-batch-admin-manager.jar gets loaded first and my application specific manager-context.xml gets loaded later.
I also tried changing the way webapp context is initialized by loading the manager-context.xml only from my webapp. Here is my webapp-context.xml. I have added comments here to explain how I am trying to load the manager-context.xml only from my webapp.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<import resource="classpath*:/META-INF/spring/batch/servlet/resources/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/bootstrap/**/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/override/**/*.xml" />
<!-- Instead of loading manager-context from spring-batch-admin-manager.jar,
the following line is commented out -->
<!-- <import resource="classpath*:/META-INF/spring/batch/servlet/manager/*.xml" /> -->
<!-- Load the manager-context.xml from my web application -->
<import resource="classpath*:/servlet/manager/manager-context.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/manager/contoller-context.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/manager/integration-context.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/override/*.xml" />
<!-- Override the standard location for spring batch admin resources -->
<bean id="resourceService" class="org.springframework.batch.admin.web.resources.DefaultResourceService">
<property name="servletPath" value="/admin-console" />
</bean>
<bean id="parameterUnpackerFilter" class="org.springframework.batch.admin.web.filter.ParameterUnpackerFilter">
<property name="prefix" value="unpack_"/>
<property name="putEmptyParamsInPath" value="true"/>
</bean>
</beans>
Unfortunately, the application is not able to load any of the free-marker templates (*.ftl files) connected to the Jobs and Executions menu and hence I am not able to use any of menus. The ftl files which I am talking about are located under src/main/resources/org/springframework/batch/admin/web/manager folder in spring-batch-admin-manager source code.
I had same problem. For solving it I created src/main/resources/org/springframework/batch/admin/web/layouts/html/navigation.ftl file with following contents:
<#assign home_url><#spring.url relativeUrl="${servletPath}/"/></#assign>
<#assign company_url><#spring.messageText code="company.url" text=companyUrl!"http://www.spring.io"/></#assign>
<#assign company_name><#spring.messageText code="company.name" text=companyName!"Spring"/></#assign>
<#assign product_url><#spring.messageText code="product.url" text=productUrl!"http://projects.spring.io/spring-batch/"/></#assign>
<#assign product_name><#spring.messageText code="product.name" text=productName!"Spring Batch"/></#assign>
<div id="primary-navigation">
<div id="primary-left">
<ul>
<#list menuManager.menus as menu>
<#if menu_index != 0 && menu_index != 3>
<#assign menu_url><#spring.url relativeUrl="${menu.url}"/></#assign>
<li>${menu.label}</li>
</#if>
</#list>
</ul>
</div>
<div id="primary-right">
<ul>
<li>${company_name}</li>
<li>${product_name}</li>
</ul>
</div>
</div><!-- /primary-navigation -->
Where <#if menu_index != 0 && menu_index != 3> I skipped "Home" menu (index = 0) and "File" menu (index = 3)
You have to override the beans that you want to modify: for example, if you want to standard menus, you'll have to override the bean standard:
<bean id="standard" parent="parentLayout">
<!--Modify this path to point to another .ftl file -->
<property name="url" value="/html/MYFILE.ftl" />
<property name="contentType" value="text/html;charset=UTF-8" />
<property name="attributes">
<props merge="true">
<prop key="body">/layouts/html/home.ftl</prop>
<!-- Matches the prefix of the servlet mapping in web.xml -->
<prop key="servletPath">#{resourceService.servletPath}</prop>
</props>
</property>
</bean>
And then you can create another ftl file without menus or with different CSS files.