From: huangjian Date: Mon, 24 Oct 2016 12:51:05 +0000 (+0800) Subject: Deploy plan file to WSO2 get error X-Git-Tag: release/mercury~30 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=9da7df516b79ba14675bbe42a90f0e2055c2fc63;p=vfc%2Fnfvo%2Fwfengine.git Deploy plan file to WSO2 get error Change-Id: Ic3d83c1a1a9330810353257860c8fa7a2446bf75 Issue-id: OCS-128 Signed-off-by: huangjian --- diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml index 187cdd3..34d905c 100644 --- a/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml @@ -147,18 +147,15 @@ - - - - + - + @@ -174,12 +171,12 @@ - + - + @@ -211,3 +208,4 @@ + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps-ext/conf/wso2bpel.yml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps-ext/conf/wso2bpel.yml index 0abbbbb..acd080c 100644 --- a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps-ext/conf/wso2bpel.yml +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps-ext/conf/wso2bpel.yml @@ -20,6 +20,15 @@ template: Hello, %s! msbServerAddr: http://127.0.0.1:80 +wso2Host: localhost +wso2HostPort: 9443 +wso2AuthUserName: admin +wso2AuthPassword: admin +wso2Path: /home/common-services/wso2/wso2bps +wso2UploadFilePath: /home/common-services/wso2/wso2bps/tmp/bpeluploads +wso2SslJksFile: /home/common-services/wso2/wso2bps/repository/resources/security/wso2carbon.jks +wso2SslJksPassword: wso2carbon + # use the simple server factory if you only want to run on a single port #server: diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps/repository/conf/carbon.xml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps/repository/conf/carbon.xml new file mode 100644 index 0000000..6973b7c --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/wso2bps/repository/conf/carbon.xml @@ -0,0 +1,683 @@ + + + + + + + + + WSO2 Business Process Server + + + BPS + + + 3.5.0 + + + + + + + + + local:/${carbon.context}/services/ + + + + + + + BusinessProcessServer + + + + + + + org.wso2.carbon + + + / + + + + + + + + + 15 + + + + + + + + + 0 + + + + + 9999 + + 11111 + + + + + + 10389 + + 8000 + + + + + + 10500 + + + + + + + org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory + + + + + + + + + java + + + + + + + + + + false + + + false + + + 600 + + + + false + + + + + + + + 30 + + + + + + + + + 15 + + + + + + ${carbon.home}/repository/deployment/server/ + + + 15 + + + ${carbon.home}/repository/conf/axis2/axis2.xml + + + 30000 + + + ${carbon.home}/repository/deployment/client/ + + ${carbon.home}/repository/conf/axis2/axis2_client.xml + + false + + + + + + + + + + admin + Default Administrator Role + + + user + Default User Role + + + + + + + + + + + + ${carbon.home}/repository/resources/security/wso2carbon.jks + + JKS + + wso2carbon + + wso2carbon + + wso2carbon + + + + + + ${carbon.home}/repository/resources/security/client-truststore.jks + + JKS + + wso2carbon + + + + + + + + + + + + + + + + + + + UserManager + + + false + + + + + + + + + + ${carbon.home}/tmp/work + + + + + + true + + + 10 + + + 30 + + + + + + 100 + + + + keystore + certificate + * + + org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor + + + + + jarZip + + org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor + + + + dbs + + org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor + + + + tools + + org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor + + + + toolsAny + + org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor + + + + + + + info + org.wso2.carbon.core.transports.util.InfoProcessor + + + wsdl + org.wso2.carbon.core.transports.util.Wsdl11Processor + + + wsdl2 + org.wso2.carbon.core.transports.util.Wsdl20Processor + + + xsd + org.wso2.carbon.core.transports.util.XsdProcessor + + + + + + false + false + true + svn + http://svnrepo.example.com/repos/ + username + password + true + + + + + + + + + + + + + + + ${require.carbon.servlet} + + + + + true + + + + + + + default repository + http://dist.wso2.org/p2/carbon/releases/4.4.1-SNAPSHOT + + + + + + + + true + + + + + + true + + diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java index c7d5f0e..10ef924 100644 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java @@ -29,7 +29,34 @@ public class Wso2BpelConfiguration extends Configuration { private String apiDescription = "Wso2bps REST API"; @NotNull private DataSourceFactory database = new DataSourceFactory(); + + @NotEmpty + private String msbServerAddr; + + @NotEmpty + private String wso2Host; + @NotEmpty + private String wso2HostPort; + + @NotEmpty + private String wso2AuthUserName; + + @NotEmpty + private String wso2AuthPassword; + + @NotEmpty + private String wso2Path; + + @NotEmpty + private String wso2UploadFilePath; + + @NotEmpty + private String wso2SslJksFile; + + @NotEmpty + private String wso2SslJksPassword; + @JsonProperty public String getTemplate() { return template; @@ -39,9 +66,6 @@ public class Wso2BpelConfiguration extends Configuration { public String getApiDescription() { return apiDescription; } - - @NotEmpty - private String msbServerAddr; @JsonProperty("database") public DataSourceFactory getDataSourceFactory() { @@ -67,5 +91,85 @@ public class Wso2BpelConfiguration extends Configuration { public void setMsbServerAddr(String msbServerAddr) { this.msbServerAddr = msbServerAddr; } + + @JsonProperty + public String getWso2Host() { + return wso2Host; + } + + @JsonProperty + public void setWso2Host(String wso2Host) { + this.wso2Host = wso2Host; + } + + @JsonProperty + public String getWso2HostPort() { + return wso2HostPort; + } + + @JsonProperty + public void setWso2HostPort(String wso2HostPort) { + this.wso2HostPort = wso2HostPort; + } + + @JsonProperty + public String getWso2AuthUserName() { + return wso2AuthUserName; + } + + @JsonProperty + public void setWso2AuthUserName(String wso2AuthUserName) { + this.wso2AuthUserName = wso2AuthUserName; + } + + @JsonProperty + public String getWso2AuthPassword() { + return wso2AuthPassword; + } + + @JsonProperty + public void setWso2AuthPassword(String wso2AuthPassword) { + this.wso2AuthPassword = wso2AuthPassword; + } + + @JsonProperty + public String getWso2Path() { + return wso2Path; + } + + @JsonProperty + public void setWso2Path(String wso2Path) { + this.wso2Path = wso2Path; + } + + @JsonProperty + public String getWso2UploadFilePath() { + return wso2UploadFilePath; + } + + @JsonProperty + public void setWso2UploadFilePath(String wso2UploadFilePath) { + this.wso2UploadFilePath = wso2UploadFilePath; + } + + @JsonProperty + public String getWso2SslJksFile() { + return wso2SslJksFile; + } + + @JsonProperty + public void setWso2SslJksFile(String wso2SslJksFile) { + this.wso2SslJksFile = wso2SslJksFile; + } + + @JsonProperty + public String getWso2SslJksPassword() { + return wso2SslJksPassword; + } + + @JsonProperty + public void setWso2SslJksPassword(String wso2SslJksPassword) { + this.wso2SslJksPassword = wso2SslJksPassword; + } } diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java deleted file mode 100644 index e5bd4bd..0000000 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.carbon.bpel.config; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.Properties; - -import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; - -public abstract class AbstractBpsProperties { - private static final Logger dmsg = Logger.getLogger(AbstractBpsProperties.class.getName()); - private Properties properties; - - protected AbstractBpsProperties() { - properties = new Properties(); - /* - * URL commonConfigURL = AbstractBpsProperties.class.getResource(getConfigName()); if - * (commonConfigURL != null) { try { properties.load(new FileInputStream(new - * File(commonConfigURL.getFile()))); } catch (IOException e) { dmsg.error(e.getMessage(), e); } - * } - */ - - File propertyFile = new File(getConfigName()); - try { - if (propertyFile != null) { - properties.load(this.getClass().getResourceAsStream("/" + propertyFile.getName())); - } - } catch (FileNotFoundException e) { - dmsg.error(e.getMessage(), e); - } catch (Exception e) { - dmsg.error(e.getMessage(), e); - } - - } - - protected abstract String getConfigName(); - - public String getProperty(String propertyName) { - String value = properties.getProperty(propertyName); - return StringUtils.trimToEmpty(value); - } -} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java deleted file mode 100644 index f53ea8c..0000000 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.carbon.bpel.config; - -public class BpsCommonProperties extends AbstractBpsProperties { - private static BpsCommonProperties instance; - - public static BpsCommonProperties getInstance() { - if (instance == null) { - instance = new BpsCommonProperties(); - } - return instance; - } - - @Override - protected String getConfigName() { - return "config.properties"; - } - -} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java deleted file mode 100644 index 7855a86..0000000 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.carbon.bpel.config; - -public class BpsExtraProperties extends AbstractBpsProperties { - private static BpsExtraProperties instance = null; - - public static synchronized BpsExtraProperties getInstance() { - if (instance == null) { - instance = new BpsExtraProperties(); - } - return instance; - } - - @Override - protected String getConfigName() { - /* - * String[] paths = null; URL url = BpsExtraProperties.class.getResource(""); if (url != null) { - * paths = url.getPath().split("jar!"); } if (paths == null || paths.length <= 1) { return null; - * } - */ - return "wso2-config.properties"; - } -} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java deleted file mode 100644 index 6f89a32..0000000 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2016 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.openo.carbon.bpel.config; - -import org.apache.commons.lang3.StringUtils; - -public class ConfigManager { - private static BpsExtraProperties extraProperties; - private static BpsCommonProperties commonProperties; - private static ConfigManager instance = null; - - private ConfigManager() { - commonProperties = BpsCommonProperties.getInstance(); - extraProperties = BpsExtraProperties.getInstance(); - } - - public static synchronized ConfigManager getInstance() { - if (instance == null) { - instance = new ConfigManager(); - } - return instance; - } - - public String getProperty(String key) { - String value = extraProperties.getProperty(key); - value = StringUtils.trimToEmpty(value); - if (StringUtils.isBlank(value)) { - return commonProperties.getProperty(key); - } - return value; - } - -} diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java index ee819de..efffe67 100644 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java @@ -67,7 +67,7 @@ import org.glassfish.jersey.media.multipart.FormDataParam; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.wso2.carbon.bpel.stub.upload.types.UploadedFileItem; -import org.openo.carbon.bpel.config.ConfigManager; +import org.openo.carbon.bpel.common.Config; import org.openo.carbon.bpel.util.JsonUtil; import org.openo.carbon.bpel.util.Xml2JsonUtil; @@ -78,7 +78,7 @@ import com.fasterxml.jackson.databind.JsonMappingException; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -@Path("/openoapi/wso2bpel/v1") +@Path("/") @Api(tags = {"wso2 bpel api"}) public class BpsPackage { @@ -101,16 +101,13 @@ public class BpsPackage { private synchronized String getConfig(String key) { if (configMap == null) { configMap = new HashMap(); - String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path"); - String jksFile = ConfigManager.getInstance().getProperty("wso2.ssl.jks.file"); - String trustStorePassword = - ConfigManager.getInstance().getProperty("wso2.ssl.trustStorePassword"); - String httpUsername = - ConfigManager.getInstance().getProperty("wso2.http.authenticator.username"); - String httpPassword = - ConfigManager.getInstance().getProperty("wso2.http.authenticator.password"); - String host = ConfigManager.getInstance().getProperty("wso2.host"); - String port = ConfigManager.getInstance().getProperty("wso2.http.port"); + String uploadFilePath = Config.getConfigration().getWso2UploadFilePath(); + String jksFile = Config.getConfigration().getWso2SslJksFile(); + String trustStorePassword = Config.getConfigration().getWso2SslJksPassword(); + String httpUsername = Config.getConfigration().getWso2AuthUserName(); + String httpPassword = Config.getConfigration().getWso2AuthPassword(); + String host = Config.getConfigration().getWso2Host(); + String port = Config.getConfigration().getWso2HostPort(); configMap.put("uploadFilePath", uploadFilePath); configMap.put("jksFile", jksFile); configMap.put("trustStorePassword", trustStorePassword); @@ -122,7 +119,7 @@ public class BpsPackage { if (configMap.containsKey(key)) { return configMap.get(key); } else { - return ConfigManager.getInstance().getProperty(key); + return ""; } } diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java index c86a01e..148e309 100644 --- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java +++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java @@ -63,7 +63,7 @@ import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.openo.carbon.bpel.config.ConfigManager; +import org.openo.carbon.bpel.common.Config; import org.openo.carbon.bpel.util.JsonUtil; import org.openo.carbon.bpel.util.SoapUtil; import org.openo.carbon.bpel.util.Xml2JsonUtil; @@ -79,7 +79,7 @@ import com.fasterxml.jackson.databind.JsonNode; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -@Path("/openoapi/wso2bpel/v1") +@Path("/") @Api(tags = {"wso2 bpel api"}) public class BpsProcess { @@ -100,7 +100,8 @@ public class BpsProcess { private synchronized String getConfig(String key) { if (configMap == null) { configMap = new HashMap(); - String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path"); + //Config.getConfigration().getMsbServerAddr(); + /* String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path"); String jksFile = ConfigManager.getInstance().getProperty("wso2.ssl.jks.file"); String trustStorePassword = ConfigManager.getInstance().getProperty("wso2.ssl.trustStorePassword"); @@ -109,7 +110,14 @@ public class BpsProcess { String httpPassword = ConfigManager.getInstance().getProperty("wso2.http.authenticator.password"); String host = ConfigManager.getInstance().getProperty("wso2.host"); - String port = ConfigManager.getInstance().getProperty("wso2.http.port"); + String port = ConfigManager.getInstance().getProperty("wso2.http.port");*/ + String uploadFilePath = Config.getConfigration().getWso2UploadFilePath(); + String jksFile = Config.getConfigration().getWso2SslJksFile(); + String trustStorePassword = Config.getConfigration().getWso2SslJksPassword(); + String httpUsername = Config.getConfigration().getWso2AuthUserName(); + String httpPassword = Config.getConfigration().getWso2AuthPassword(); + String host = Config.getConfigration().getWso2Host(); + String port = Config.getConfigration().getWso2HostPort(); configMap.put("uploadFilePath", uploadFilePath); configMap.put("jksFile", jksFile); configMap.put("trustStorePassword", trustStorePassword); @@ -121,7 +129,7 @@ public class BpsProcess { if (configMap.containsKey(key)) { return configMap.get(key); } else { - return ConfigManager.getInstance().getProperty(key); + return ""; } }