Follow Us on Twitter

Building OSB 12c releases on resource level using Maven

by Mike Heeren on January 12, 2017 · 58 comments

A while ago I published a Whitebook (in Dutch) about building OSB 12c releases on resource level using Maven. In the Whitebook, you could read which functionality we were missing in the regular Oracle Service Bus plugin for Maven and how we were able to create this functionality using a custom Maven plugin.

I have added the code of this custom Maven plugin to the following public repository: https://bitbucket.org/whitehorsesbv/servicebusplugin

Used settings

The custom Maven plugin has been developed and tested on multiple environments, so we can confirm that the Maven plugin is working if you are using the following version(s):

Application Version
Java 1.7.0_79, 1.8.0_101
Maven 3.3.9
Oracle Service Bus 12.1.3, 12.2.1

Installing the custom Maven plugin

First start to install the custom Maven plugin to your local Maven repository. To do this, you can download both the JAR and the POM file from the download page of the repository. After you have downloaded both files, you can execute the following commands to install it to you local Maven repository:

mvn install:install-file -Dfile=servicebus-plugin-1.0.jar -DgroupId=nl.whitehorses.servicebus -DartifactId=servicebus-plugin -Dversion=1.0 -Dpackaging=jar
mvn install:install-file -Dfile=servicebus-plugin-1.0.pom -DgroupId=nl.whitehorses.servicebus -DartifactId=servicebus-plugin -Dversion=1.0 -Dpackaging=pom

Building a Service Bus project on resource level

Now that the custom Maven plugin is available in the Maven repository, we are able to build OSB projects using this plugin instead of the default Oracle plugin. To do so, open the pom.xml file in the OSB project directory. By default, the pom.xml file will look something like the below example:

pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
	<modelVersion>4.0.0</modelVersion> 
	<parent> 
		<groupId>com.oracle.servicebus</groupId> 
		<artifactId>sbar-project-common</artifactId> 
		<version>12.1.3-0-0</version> 
	</parent> 
	<groupId>nl.whitehorses</groupId> 
	<artifactId>Employee</artifactId> 
	<version>1.0-SNAPSHOT</version> 
	<packaging>sbar</packaging> 
	<description/> 
</project>

If we package the project into an archive using the above pom.xml file by executing mvn package via the command line, we will get an archive that can be used to deploy the OSB project on project level to the OSB. The build archive can be found in the .data/maven folder within the project directory.

If we change the value of the pom.xml file to the below example, and we package the project the project using the same command, we will get an archive  which can be used to deploy on resource level via the OSB. In the below example the following files will be added to the archive:

  • All files within the Business directory.
  • All files within the Pipeline directory, except UpdateEmployee.pipeline.

pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
	<modelVersion>4.0.0</modelVersion> 
	<groupId>nl.whitehorses</groupId> 
	<artifactId>Employee</artifactId> 
	<version>1.0-SNAPSHOT</version> 
	<packaging>sbar</packaging> 
	<build> 
		<directory>${project.basedir}/.data/maven</directory> 
		<sourceDirectory>${project.basedir}</sourceDirectory> 
		<resources> 
			<resource> 
				<directory>${project.basedir}</directory> 
			</resource> 
		</resources> 
		<plugins> 
			<plugin> 
				<groupId>nl.whitehorses.servicebus</groupId> 
				<artifactId>servicebus-plugin</artifactId> 
				<version>1.0</version> 
				<extensions>true</extensions> 
				<configuration> 
					<!-- Configure the Oracle Home directory --> 
					<oracleHome>C:\Oracle\Middleware1221\Oracle_Home</oracleHome> 
					<!-- Specify whether this is a system release --> 
					<system>false</system> 
					<!-- Configure the export level of the release, possible values are PROJECT and RESOURCE --> 
					<exportLevel>RESOURCE</exportLevel> 
					<!-- Optional parameter to specify which of the resources should be included into the archive --> 
					<includes> 
						<include>**/Business/*</include> 
						<include>**/Pipeline/*</include> 
					</includes> 
					<!-- Optional parameter to specify which of the resources should be excluded from the archive --> 
					<excludes> 
						<exclude>**/Pipeline/UpdateEmployee.pipeline</exclude> 
					</excludes> 
				</configuration> 
			</plugin> 
		</plugins> 
	</build> 
</project>

Instead of using the includes and excludes tags, we can also add a resources tag to the pom.xml file, which points towards a configuration file. This can be used to specify which files need to be included and excluded. For example, the below files will result in exactly the same archive as we would get using the includes and excludes tags: 

pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
	<modelVersion>4.0.0</modelVersion> 
	<groupId>nl.whitehorses</groupId> 
	<artifactId>Employee</artifactId> 
	<version>1.0-SNAPSHOT</version> 
	<packaging>sbar</packaging> 
	<build> 
		<directory>${project.basedir}/.data/maven</directory> 
		<sourceDirectory>${project.basedir}</sourceDirectory> 
		<resources> 
			<resource> 
				<directory>${project.basedir}</directory> 
			</resource> 
		</resources> 
		<plugins> 
			<plugin> 
				<groupId>nl.whitehorses.servicebus</groupId> 
				<artifactId>servicebus-plugin</artifactId> 
				<version>1.0</version> 
				<extensions>true</extensions> 
				<configuration> 
					<!-- Configure the Oracle Home directory --> 
					<oracleHome>C:\Oracle\Middleware1221\Oracle_Home</oracleHome> 
					<!-- Specify whether this is a system release --> 
					<system>false</system> 
					<!-- Configure the export level of the release, possible values are PROJECT and RESOURCE --> 
					<exportLevel>RESOURCE</exportLevel> 
					<!-- Optional parameter to specify which of the resources should be included into and excluded from the archive --> 
					<resources>C:\JDeveloper\mywork\Whitehorses\Employee\archiveResources.xml</resources> 
				</configuration> 
			</plugin> 
		</plugins> 
	</build> 
</project>

archiveResources.xml

<?xml version="1.0" encoding="UTF-8"?> 
<resources> 
	<!-- Optional parameter to specify which of the resources should be included into the archive --> 
	<includes> 
		<include>**/Business/*</include> 
		<include>**/Pipeline/*</include> 
	</includes> 
	<!-- Optional parameter to specify which of the resources should be excluded from the archive --> 
	<excludes> 
		<exclude>**/Pipeline/UpdateEmployee.pipeline</exclude> 
	</excludes> 
</resources>

Adding an Assembly project to add multiple projects to single archive

The final step of creating full OSB release archives on resource level, was that we wanted to add multiple projects to a single archive. We achieved this by first building every OSB project separately, and later build an Assembly application which combines all projects into a single archive file. To do this, we use the parent pom.xml file to build all projects (including the assembly project). It is important that the assembly project is build last.

The parent pom.xml file, which will build every project, including the assembly project, will look something like the below example:

pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
	<modelVersion>4.0.0</modelVersion> 
	<groupId>nl.whitehorses</groupId> 
	<artifactId>Whitehorses</artifactId> 
	<version>1.0-SNAPSHOT</version> 
	<packaging>pom</packaging> 
	<modules> 
		<!-- All OSB projects --> 
		<module>Clockwise</module> 
		<module>Employee</module> 
		<module>Office</module> 
		<!-- Assembly project --> 
		<module>Assembly</module> 
	</modules> 
</project>

The pom.xml file of the Assembly project will look like the below example. It is important that if you add new projects, you don’t only add them to the parent pom.xml file, but you also add them as a dependency to the Assembly project. 

pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
	<modelVersion>4.0.0</modelVersion> 
	<groupId>nl.whitehorses</groupId> 
	<artifactId>Assembly</artifactId> 
	<version>1.0-SNAPSHOT</version> 
	<dependencies> 
		<dependency> 
			<groupId>nl.whitehorses</groupId> 
			<artifactId>Clockwise</artifactId> 
			<version>1.0-SNAPSHOT</version> 
			<type>sbar</type> 
		</dependency> 
		<dependency> 
			<groupId>nl.whitehorses</groupId> 
			<artifactId>Employee</artifactId> 
			<version>1.0-SNAPSHOT</version> 
			<type>sbar</type> 
		</dependency> 
		<dependency> 
			<groupId>nl.whitehorses</groupId> 
			<artifactId>Office</artifactId> 
			<version>1.0-SNAPSHOT</version> 
			<type>sbar</type> 
		</dependency> 
	</dependencies> 
	<build> 
		<finalName>sbconfig_${project.version}</finalName> 
		<plugins> 
			<plugin> 
				<artifactId>maven-jar-plugin</artifactId> 
				<version>2.6</version> 
				<executions> 
					<execution> 
						<id>default-jar</id> 
						<phase>never</phase> 
					</execution> 
				</executions> 
			</plugin> 
			<plugin> 
				<artifactId>maven-assembly-plugin</artifactId> 
				<version>2.6</version> 
				<configuration> 
					<appendAssemblyId>false</appendAssemblyId> 
					<descriptors> 
						<descriptor>${basedir}/src/main/assembly/assembly.xml</descriptor> 
					</descriptors> 
				</configuration> 
				<dependencies> 
					<dependency> 
						<groupId>nl.whitehorses.servicebus</groupId> 
						<artifactId>servicebus-plugin</artifactId> 
						<version>1.0</version> 
					</dependency> 
				</dependencies> 
				<executions> 
					<execution> 
						<id>make-assembly</id> 
						<phase>package</phase> 
						<goals> 
							<goal>single</goal> 
						</goals> 
					</execution> 
				</executions> 
			</plugin> 
		</plugins> 
	</build> 
</project>

This pom.xml file also points to an assembly.xml file, which contains some configuration about how the Assembly archive should be build bij the Maven assembly plugin. This assembly.xml file should look like the below example: 

assembly.xml

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> 
	<id>src</id> 
	<formats> 
		<format>sbar</format> 
	</formats> 
	<includeBaseDirectory>false</includeBaseDirectory> 
	<dependencySets> 
		<dependencySet> 
			<outputDirectory>/</outputDirectory> 
			<unpack>true</unpack> 
		</dependencySet> 
	</dependencySets> 
</assembly>

If you navigate to the directory which contains the parent pom.xml file, and you execute mvn install via the command line, the OSB release will be build.

For a working example of the above, please download: Building-OSB-12c-releases-on-resource-level-using-Maven.zip

Deploying the archive via Maven

It is also possible to deploy the generated (Assembly) archive directly to an OSB server via the Maven plugin. To achieve this, we should add the deploy-assembly goal of the custom Maven plugin to the desired Maven phase. We chose the pre-integration-test phase for deploying the archive to the OSB server. The pom.xml file in the Assembly project can be updated like the below example to connect the Maven pre-integration-test phase to the deploy-assembly goal of the Maven plugin:

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
	<modelVersion>4.0.0</modelVersion> 
	<groupId>nl.whitehorses</groupId> 
	<artifactId>Assembly</artifactId> 
	<version>1.0-SNAPSHOT</version> 
	<dependencies> 
		<dependency> 
			<groupId>nl.whitehorses</groupId> 
			<artifactId>Clockwise</artifactId> 
			<version>1.0-SNAPSHOT</version> 
			<type>sbar</type> 
		</dependency> 
		<dependency> 
			<groupId>nl.whitehorses</groupId> 
			<artifactId>Employee</artifactId> 
			<version>1.0-SNAPSHOT</version> 
			<type>sbar</type> 
		</dependency> 
		<dependency> 
			<groupId>nl.whitehorses</groupId> 
			<artifactId>Office</artifactId> 
			<version>1.0-SNAPSHOT</version> 
			<type>sbar</type> 
		</dependency> 
	</dependencies> 
	<build> 
		<finalName>sbconfig_${project.version}</finalName> 
		<plugins> 
			<plugin> 
				<artifactId>maven-jar-plugin</artifactId> 
				<version>2.6</version> 
				<executions> 
					<execution> 
						<id>default-jar</id> 
						<phase>never</phase> 
					</execution> 
				</executions> 
			</plugin> 
			<plugin> 
				<artifactId>maven-assembly-plugin</artifactId> 
				<version>2.6</version> 
				<configuration> 
					<appendAssemblyId>false</appendAssemblyId> 
					<descriptors> 
						<descriptor>${basedir}/src/main/assembly/assembly.xml</descriptor> 
					</descriptors> 
				</configuration> 
				<dependencies> 
					<dependency> 
						<groupId>nl.whitehorses.servicebus</groupId> 
						<artifactId>servicebus-plugin</artifactId> 
						<version>1.0</version> 
					</dependency> 
				</dependencies> 
				<executions> 
					<execution> 
						<id>make-assembly</id> 
						<phase>package</phase> 
						<goals> 
							<goal>single</goal> 
						</goals> 
					</execution> 
				</executions> 
			</plugin>
			<plugin>
				<groupId>nl.whitehorses.servicebus</groupId> 
				<artifactId>servicebus-plugin</artifactId> 
				<version>1.0</version> 
				<executions>
					<execution>
						<id>deploy-assembly</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>deploy-assembly</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins> 
	</build> 
</project>

If we navigate to the directory containing the parent pom.xml file again, we will be able to deploy the release to the OSB server by executing the mvn pre-integration-test statement. The following parameters must/can be added to this command:

Parameter Required? Default value
-Dserver.url Yes
-Dserver.username Yes
-Dserver.password Yes
-Ddeployment.preserve.credentials true
-Ddeployment.preserve.envValues true
-Ddeployment.preserve.operationalValues true
-Ddeployment.preserve.securityAndPolicyConfig true
-Ddeployment.preserve.accessControlPolicies true
-Ddeployment.customization.file No
-Ddeployment.session.activate true
-Ddeployment.session.discardOnError true

 

These settings represent the “Advanced Settings” when manually uploading an archive via the servicebus console.

Good luck building your OSB releases on resouce level using Maven!

Building OSB 12c releases on resource level using Maven, 5.0 out of 5 based on 1 rating
Ratings:
VN:D [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)

{ 58 comments… read them below or add one }

Alfonso January 14, 2017 at 1:12 am

Hi Mike,
Great post !!!

One question, to deploy the project in the OSB. I guess one should execute the “mvn pre-integration-test” command via the command line at the parent pom.xml file. Right?

Reply

Mike Heeren January 16, 2017 at 9:53 am

Hi Alfonso,

With a few steps you will be able to deploy the project to the OSB server using the pre-integration-test phase indeed. I have added these steps to the article!

Reply

Alfonso January 16, 2017 at 8:23 pm

Hi Mike,
Thanks for your reply and update to the article.

After following your instructions to do the deployment, I am having the following error:

[ERROR] Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.0:deploy-assembly (deploy-assembly) on project Assembly: Unable to import artifact [/Whitehorses/Assembly/target/sbconfig_1.0-SNAPSHOT.sbar] to session [ServiceBusPlugin_Assembly_1484590426986]: error: Use of undefined namespace prefix: imp -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.0:deploy-assembly (deploy-assembly) on project Assembly: Unable to import artifact [/Whitehorses/Assembly/target/sbconfig_1.0-SNAPSHOT.sbar] to session [ServiceBusPlugin_Assembly_1484590426986]

I am having this same issue trying to deploy your project and also my project (which also is configured to use the custom plugin)

Appreciate your help

Reply

Alfonso January 16, 2017 at 8:48 pm

Hi Mike,

When deploying your project and my project.

I am getting the following error:

[ERROR] Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.0:deploy-assembly (deploy-assembly) on project Assembly: Unable to import artifact [/Whitehorses/Assembly/target/sbconfig_1.0-SNAPSHOT.sbar] to session [ServiceBusPlugin_Assembly_1484590426986]: error: Use of undefined namespace prefix: imp -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.0:deploy-assembly (deploy-assembly) on project Assembly: Unable to import artifact [/Whitehorses/Assembly/target/sbconfig_1.0-SNAPSHOT.sbar] to session [ServiceBusPlugin_Assembly_1484590426986]

More details:
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to import artifact [/Users/alfonso/Downloads/Whitehorses/Assembly/target/sbconfig_1.0-SNAPSHOT.sbar] to session [ServiceBusPlugin_Assembly_1484590426986]
…..
Caused by: org.apache.xmlbeans.XmlException: error: Use of undefined namespace prefix: imp
……
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Searching through the project I did not find any “imp” prefix.

Have you come across this error?

Reply

Alfonso January 16, 2017 at 9:26 pm

HI Mike,

The only reference to the “imp” qualifier was by opening the “ExportInfo” file (inside an sbarfile). In there, I saw the following namespace: xmlns:imp=”http://www.bea.com/wli/config/importexport”

The content is basically an XML and everything seems ok. The qualifier is being used in the elements.

Any ideas?

Reply

Alfonso January 17, 2017 at 5:14 am

Hi Mike,

Based on my last reply, I confirm you that the issue I was having was the namespace prefix at the ExportInfo file inside the .sbar file which contains more than one project (which is located in the folder Assembly/target)

I did some changes in the Java class “nl.whitehorses.servicebus.archiver.SbarArchiver.java” of the plugin.
Basically the changes was to allow the appearance of the prefix in the corresponding elements.

Then I re-built the plugin (mvn package), re-install it as mentioned in your article (mvn install:install-file -Dfile=servicebus-plugin-1.0.jar -DgroupId=nl.whitehorses.servicebus -DartifactId=servicebus-plugin -Dversion=1.0 -Dpackaging=jar)

Finally, I redeployed the OSB projects (in a bundle): mvn pre-integration-test

NOTE: please let me know if by any chance you had this same issue during deployment. Also I will be more than welcome to share with you the changes on the Java class, just let me know. It would be great to know your point of view regarding the changes I did.

Reply

Mike Heeren January 17, 2017 at 8:39 am

Hi Alfonso,

Which version of OSB are you using? I have just checked for OSB 12.1.3 and I don’t see the issue there. Perhaps there is a difference in the expected content of the ExportInfo file between OSB 12.1.3 and OSB 12.2.1.

Reply

Alfonso January 17, 2017 at 3:28 pm

I am using version 12.2.1

Reply

Mike Heeren January 17, 2017 at 8:45 pm

Hi Alfonso,

I found a difference in the generated ExportInfo file between OSB 12.1.3 and 12.2.1 indeed. I have fixed the issue and uploaded a new version (1.1) of the JAR and POM file to the download page. If you download and install this version to you local Maven repository, and use this version in your pom.xml files, you should be able to build and deploy your archives.

Please let me know if you have any issues!

Reply

Alfonso January 17, 2017 at 10:51 pm

Hi Mike,

I managed to test the 1.1 version without any troubles.

Just for the sake of this article, to install/run version 1.1 it is needed to:
1)- Install the jar and pom file executing:

mvn install:install-file -Dfile=servicebus-plugin-1.1.jar -DgroupId=nl.whitehorses.servicebus -DartifactId=servicebus-plugin -Dversion=1.1 -Dpackaging=jar

mvn install:install-file -Dfile=servicebus-plugin-1.1.pom -DgroupId=nl.whitehorses.servicebus -DartifactId=servicebus-plugin -Dversion=1.1 -Dpackaging=pom

2)- Update the value of the element in following POM files:
– At the project level
– Inside the Assembly project/folder

The changes would be in this section (specifically in the value of the element):

nl.whitehorses.servicebus
servicebus-plugin
1.1 ———> HERE
….

Regards

Reply

Alfonso January 25, 2017 at 9:08 pm

Hi Mike,

Is there a way to change the location of the .sbar file that gets generated?

As you know, this file is located in a folder which name is “target”. Is it possible to specify a different name for that folder. A way to specify this could be, for example, in the pom.xml file (inside the Assembly folder).

Thanks

Reply

Mike Heeren January 26, 2017 at 8:54 am

Hi Alfonso,

Yes, this can be achieved via the Assembly pom.xml file. Just add a directory element within the build element. For example:


<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.whitehorses</groupId>
<artifactId>Assembly</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
...
</dependencies>
<build>
<directory>${project.basedir}/custom_target_dir</directory>
<finalName>sbconfig_${project.version}</finalName>
<plugins>
...
</plugins>
</build>
</project>

Reply

Alfonso February 1, 2017 at 8:26 pm

Hi Mike,

Thanks for your reply.

For the plugin to work, is it mandatory to have configured maven.oracle.com as a repository in settings.xml (in .m2 folder)?

Reply

Mike Heeren February 8, 2017 at 6:30 pm

Hi Alfonso,

Yes, you will need to be able to access the Oracle Maven repository. You can read more about how to connect to the Oracle Maven repository here: http://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm

Reply

erpsandeep February 11, 2017 at 2:03 pm

It’s a Nice Blog to read and share thanks for posting. Post as many blogs it can be more important………….

Reply

Srikanth Reddy K April 18, 2017 at 8:46 am

Hi Mike,

I am having errors while deploying the script that you have provided. Could you please help me in this?
I am using OSB 12.2.1 version and plugin 1.1

Below is the error
==============

java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:268)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:304)
at javax.management.remote.rmi.RMIConnectionImpl_12210_WLStub.invoke(Unknown Source)
at weblogic.management.remote.common.RMIConnectionWrapper$16.run(ClientProviderBase.java:1105)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.security.Security.runAs(Security.java:61)
at weblogic.management.remote.common.RMIConnectionWrapper.invoke(ClientProviderBase.java:1103)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1020)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:298)
at com.sun.proxy.$Proxy26.importUploaded(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at oracle.sb.maven.plugin.deploy.MBeanHelper$MBeanInvocationHandler.invoke(MBeanHelper.java:139)
at com.sun.proxy.$Proxy26.importUploaded(Unknown Source)
at nl.whitehorses.servicebus.DeployAssemblyMojo.importArtifact(DeployAssemblyMojo.java:180)
at nl.whitehorses.servicebus.DeployAssemblyMojo.execute(DeployAssemblyMojo.java:95)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation
at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:208)
at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:135)
at weblogic.rmi.utils.Utilities.loadClass(Utilities.java:306)
at weblogic.rjvm.MsgAbbrevInputStream.resolveClass(MsgAbbrevInputStream.java:439)
at weblogic.utils.io.ChunkedObjectInputStream$NestedObjectInputStream.resolveClass(ChunkedObjectInputStream.java:268)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1819)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1986)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2155)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at java.util.HashSet.readObject(HashSet.java:333)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2122)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2155)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at java.util.HashMap.readObject(HashMap.java:1404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2122)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2155)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:602)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:264)
… 39 more
[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO]
[INFO] SCBCustomServices ……………………………. SUCCESS [ 37.048 s]
[INFO] TLMIntegrationService ………………………… SUCCESS [ 12.265 s]
[INFO] Assembly ……………………………………. FAILURE [02:00 min]
[INFO] OIDXExtensions ………………………………. SKIPPED
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 02:53 min
[INFO] Finished at: 2017-04-17T17:13:33+05:30
[INFO] Final Memory: 29M/583M
[INFO] ————————————————————————
[ERROR] Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.1:deploy-assembly (deploy-assembly) on project Assembly: Unable to read artifact [C:\JDeveloper\mywork06042017\SrvVirt\OIDXExtensions\Assembly\target\sbconfig_1.0.sbar]: failed to unmarshal class java.lang.Object; nested exception is:
[ERROR] java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation
[ERROR] -> [Help 1]

Reply

Mike Heeren April 19, 2017 at 7:52 pm

Hi Srikanth,

It looks like this is an issue with the Weblogic server/OSB installation. Do you try to deploy the artifact to a clustered environment? Do you see any issues in the Weblogic log? Did you already tried to restart the server?

The error occurs in de deployment phase, so the SBAR file itself should be generated without a problem. Are you able to manually import the generated SBAR file via the servicebus console?

Reply

Srikanth Reddy K April 22, 2017 at 7:05 am

Hi Mike,

Thanks for looking into this. About domain, it is already the working one. Yeah, sbar file is creating successfully but unable to deploy it to the sbconsole. While deploying only the above issue occurs. And one more is, i am unable to undeploy the existed project. Could you please provide those script as well if you got any chance? Thanks again.

Reply

Mike Heeren April 23, 2017 at 8:52 pm

Hi Srikanth,

It looks like an issue on the Weblogic server. Did you already tried to restart the server?

Are you able to deploy other archive files to the server without any issues?

Reply

Srikanth Reddy K April 24, 2017 at 6:07 am

Mike, Yes, I have restarted the server and tested again and the result is same. I am able to deploy artifacts manually but not with maven. Is there anything I am missing here? Thanks

Srikanth Reddy K April 24, 2017 at 10:47 am

Hi Mike, I am able to deploy the generated artifact in to sbconsole manually but unable to deploy it using your maven servicebus plugin. Could you please check this once you got time? Thank you

Error Log
========

java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:268)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:304)
at javax.management.remote.rmi.RMIConnectionImpl_12210_WLStub.invoke(Unknown Source)
at weblogic.management.remote.common.RMIConnectionWrapper$16.run(ClientProviderBase.java:1105)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.security.Security.runAs(Security.java:61)
at weblogic.management.remote.common.RMIConnectionWrapper.invoke(ClientProviderBase.java:1103)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1020)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:298)
at com.sun.proxy.$Proxy27.importUploaded(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at oracle.sb.maven.plugin.deploy.MBeanHelper$MBeanInvocationHandler.invoke(MBeanHelper.java:139)
at com.sun.proxy.$Proxy27.importUploaded(Unknown Source)
at nl.whitehorses.servicebus.DeployAssemblyMojo.importArtifact(DeployAssemblyMojo.java:180)
at nl.whitehorses.servicebus.DeployAssemblyMojo.execute(DeployAssemblyMojo.java:95)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation
at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:208)
at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:135)
at weblogic.rmi.utils.Utilities.loadClass(Utilities.java:306)
at weblogic.rjvm.MsgAbbrevInputStream.resolveClass(MsgAbbrevInputStream.java:439)
at weblogic.utils.io.ChunkedObjectInputStream$NestedObjectInputStream.resolveClass(ChunkedObjectInputStream.java:268)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1819)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1986)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2155)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at java.util.HashSet.readObject(HashSet.java:333)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2122)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2155)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at java.util.HashMap.readObject(HashMap.java:1404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2122)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2231)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2155)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2013)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:602)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:264)
… 39 more
[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO]
[INFO] OIDXPartnerServices ………………………….. SUCCESS [ 15.898 s]
[INFO] OIDXProducer ………………………………… SUCCESS [ 15.680 s]
[INFO] OIDXShared ………………………………….. SUCCESS [ 16.982 s]
[INFO] UnitTests …………………………………… SUCCESS [ 14.446 s]
[INFO] JavaCallouts ………………………………… SUCCESS [ 9.773 s]
[INFO] Assembly ……………………………………. FAILURE [01:51 min]
[INFO] OIDXCore ……………………………………. SKIPPED
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 03:08 min
[INFO] Finished at: 2017-04-24T14:13:39+05:30
[INFO] Final Memory: 64M/530M
[INFO] ————————————————————————
[ERROR] Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.1:deploy-assembly (deploy-assembly) on project Assembly: Unable to read artifact [C:\JDeveloper\mywork06042017\SrvVirt\OIDXCore\Assembly\target\sbconfig_1.0-SNAPSHOT.sbar]: failed to unmarshal class java.lang.Object; nested exception is:
[ERROR] java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Srikanth Reddy K April 24, 2017 at 1:22 pm

Mike, It seems that the generated artifact is unable to read by maven using your plugin. Below is the error statement.

Error Statement
=============
Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.1:deploy-assembly (deploy-assembly) on project Assembly: Unable to read artifact [C:\JDeveloper\mywork06042017\SrvVirt\OIDXCore\Assembly\target\sbconfig_1.0-SNAPSHOT.sbar]: failed to unmarshal class java.lang.Object; nested exception is: java.lang.ClassNotFoundException: Failed to load class com.bea.wli.sb.util.ResourceDiagnosticLocation

Could you please validate it from your end too. Because I have restarted the domains and the problem still exists. Am I missing anything here?

Below is the command I am using to deploy the artifact.

Deploy Command
==============
mvn pre-integration-test -Dserver.url=http://localhost:7001 -Dserver.username=weblogic -Dserver.password=weblogic123 -DconfigJar=C:\JDeveloper\mywork06042017\SrvVirt\OIDXCore\Assembly\target\sbconfig_1.0-SNAPSHOT.sbar -Ddeployment.customization.file=C:\JDeveloper\mywork06042017\SrvVirt\OIDXCore\OSBCoreCustomizationFile-Template_9.0.0.xml

Please correct me if I am making any mistake. Please ask me if you need more details regarding my domain. Thank you.

Srikanth Reddy K April 24, 2017 at 1:25 pm

In addition to the above deploy command, I have tested without configJar parameter also. The result is same.

Below is the command:
===================
mvn clean pre-integration-test -Dserver.url=http://localhost:7001 -Dserver.username=weblogic -Dserver.password=weblogic123 -Ddeployment.customization.file=C:\JDeveloper\mywork06042017\SrvVirt\OIDXCore\OSBCoreCustomizationFile-Template_9.0.0.xml

Mike Heeren May 2, 2017 at 8:21 pm

Hi Srikanth,

First of all, the “-DconfigJar” parameter is not supported by plugin, so you do not need to provide this parameter. I don’t see any issue in the code of the servicebus plugin regarding this problem. What I do see in the stacktrace, is that multiple exceptions are thrown regarding RMI and authentication.

I guess HTTP tunneling is not supported by your Weblogic server, and therefor the build SBAR file could not be transfered to the Weblogic adminserver.

If this is the issue you could try the following solutions:

1. Use T3 protocol instead of HTTP. More information about the T3 protocol can be found here: http://docs.oracle.com/cd/E17904_01/apirefs.1111/e13952/taskhelp/channels/ConfigureT3Protocol.html

When you would like to use the T3 protocol, use the following command: “mvn clean pre-integration-test -Dserver.url=t3://localhost:7001 -Dserver.username=weblogic -Dserver.password=weblogic123 -Ddeployment.customization.file=C:\JDeveloper\mywork06042017\SrvVirt\OIDXCore\OSBCoreCustomizationFile-Template_9.0.0.xml”

2. Another solution would be to enable HTTP tunneling. Some information about configuring HTTP tunneling can be found here: https://docs.oracle.com/cd/E13222_01/wls/docs81/adminguide/web_server.html#111163

Srikanth Reddy K May 3, 2017 at 12:02 pm

Thanks for the reply Mike, I have followed your steps like using t3 protocol instead of HTTP and t3 protocol configuration on Servers and Enable HTTP Tunning on all servers. But I am getting the same error which I have posted earlier. Mainly, I can able to deploy the generated sbar manually but unable to do it using maven. Any alternate suggestion is much appreciated. Thanks again!

Abhishek June 26, 2017 at 9:29 pm

Hi Mike,

I am getting below error for deploying . I have installed xmlbeans 2.5 jar to lcoal repository also

[ERROR] Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.0:package (default-package) on project ContractorInfoNonConfServiceDelta: Execution default-package of goal nl.whitehorses.servicebus:servicebus-plugin:1.0:package failed: A required class was missing while executing nl.whitehorses.servicebus:servicebus-plugin:1.0:package: org.apache.xmlbeans.XmlException
[ERROR] —————————————————–
[ERROR] realm = plugin>nl.whitehorses.servicebus:servicebus-plugin:1.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/opt/eai/ci/m2/nl/whitehorses/servicebus/servicebus-plugin/1.0/servicebus-plugin-1.0.jar
[ERROR] urls[1] = file:/opt/eai/ci/m2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>nl.whitehorses:ContractorInfoNonConfServiceDelta:1.0, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] —————————————————–
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.0:package (default-package) on project ContractorInfoNonConfServiceDelta: Execution default-package of goal nl.whitehorses.servicebus:servicebus-plugin:1.0:package failed: A required class was missing while executing nl.whitehorses.servicebus:servicebus-plugin:1.0:package: org.apache.xmlbeans.XmlException
—————————————————–
realm = plugin>nl.whitehorses.servicebus:servicebus-plugin:1.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/opt/eai/ci/m2/nl/whitehorses/servicebus/servicebus-plugin/1.0/servicebus-plugin-1.0.jar
urls[1] = file:/opt/eai/ci/m2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[project>nl.whitehorses:ContractorInfoNonConfServiceDelta:1.0, parent: ClassRealm[maven.api, parent: null]]]
—————————————————–
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-package of goal nl.whitehorses.servicebus:servicebus-plugin:1.0:package failed: A required class was missing while executing nl.whitehorses.servicebus:servicebus-plugin:1.0:package: org.apache.xmlbeans.XmlException
—————————————————–
realm = plugin>nl.whitehorses.servicebus:servicebus-plugin:1.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/opt/eai/ci/m2/nl/whitehorses/servicebus/servicebus-plugin/1.0/servicebus-plugin-1.0.jar
urls[1] = file:/opt/eai/ci/m2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[project>nl.whitehorses:ContractorInfoNonConfServiceDelta:1.0, parent: ClassRealm[maven.api, parent: null]]]
—————————————————–
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:166)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
… 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing nl.whitehorses.servicebus:servicebus-plugin:1.0:package: org.apache.xmlbeans.XmlException
—————————————————–
realm = plugin>nl.whitehorses.servicebus:servicebus-plugin:1.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/opt/eai/ci/m2/nl/whitehorses/servicebus/servicebus-plugin/1.0/servicebus-plugin-1.0.jar
urls[1] = file:/opt/eai/ci/m2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[project>nl.whitehorses:ContractorInfoNonConfServiceDelta:1.0, parent: ClassRealm[maven.api, parent: null]]]
—————————————————–
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:164)
… 20 more
Caused by: java.lang.NoClassDefFoundError: org.apache.xmlbeans.XmlException
at java.lang.J9VMInternals.prepareClassImpl(Native Method)

Nagaraju Daramukkala April 20, 2017 at 7:38 pm

Hi Mike,
I loved you article and we are looking for the same solution from long time and good we found your article to which reduced our efforts to achieve it.
Does your plugin accepts customization filename as parameter.

Appreciate your help

Regards,
Nagaraju

Reply

Nagaraju Daramukkala April 20, 2017 at 11:05 pm

Hi Mike,

I am able to pass customization file as input but getting the below error

[INFO] Scanning for projects…
[INFO]
[INFO] ————————————————————————
[INFO] Building AWS 1.0
[INFO] ————————————————————————
[INFO]
[INFO] — servicebus-plugin:1.1:package (default-package) @ AWS —
[INFO]
[INFO] — servicebus-plugin:1.1:deploy-assembly (deploy-assembly) @ AWS —
[INFO] Deploying assembly [C:\beachbody\sourcecode\esb12c\src\AWS\.data\maven\AW
S-1.0.sbar]
[INFO] Creating session [ServiceBusPlugin_AWS_1492721966747]
[INFO] Importing artifact [C:\beachbody\sourcecode\esb12c\src\AWS\.data\maven\AW
S-1.0.sbar] to session [ServiceBusPlugin_AWS_1492721966747]
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 20.395 s
[INFO] Finished at: 2017-04-20T13:59:28-07:00
[INFO] Final Memory: 21M/339M
[INFO] ————————————————————————
[ERROR] Failed to execute goal nl.whitehorses.servicebus:servicebus-plugin:1.1:d
eploy-assembly (deploy-assembly) on project AWS: Unable to read artifact [C:\bea
chbody\sourcecode\esb12c\src\AWS\.data\maven\AWS-1.0.sbar]: File ‘C:\beachbody\s
ourcecode\esb12c\src\AWS\.data\maven\AWS-1.0.sbar’ does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

seems package goal is writing the files as sbconfig.sbar and when trying to deploy-assembly goal it is referring to project artifcatid.sbar as filename.

Can you help me here.

Reply

Mike Heeren April 23, 2017 at 9:06 pm

Hi Nagaraju,

It is possible to customize the assembly archive filename indeed. This can be achieved by changing the project/build/finalName property in the assembly project pom.xml file.

If you have changed this property, you should be able to run the “mvn pre-integration-test” command (with the required parameters) on the assembly project. This command should first generate a new SBAR archive file (with its filename based on the project/build/finalName property), and deploy this file to the server next.

Reply

Nagaraju Daramukakla June 9, 2017 at 8:25 am

Mike,
I haven’t checked you response till now, I am sorry.
I was able to resolve it and made it working for deployment but th only problem is each deployment is taking 5-6 mins and we have 60 lines to deploy which itself taking more than2-3 hrs just for deployment.

We have project with multiple artifacts change in the same project, Is there way we can deploy both the artifact with in single build

e.g: Project A has test1.wsdl and schema.xsd file and i wanted to deploy both the artifacts at the same time to decrease the deployment time.

Appreciate your help.

Regards,
Nagaraju

Reply

sentheel April 28, 2017 at 10:52 am

Hello Mike,
can we use this plugin for 11g.. ?

Thanks,
Sentheel

Reply

Mike Heeren May 2, 2017 at 7:38 pm

Hi Sentheel,

No, this plugin is an extension of the Maven plugin which was introduced by Oracle since version 12c. Therefor you also require version 12c when you’d like to use this plugin.

However, you should be able to find multiple articles about building OSB 11g releases using Maven. These solutions also use the Configjar tool, so perhaps the theory about the Configjar tool from this blog post, in combination with one of the OSB 11g solutions can help you?

Reply

Srikanth Reddy K June 7, 2017 at 8:54 am

How to undeploy it. (Not manually). Could you please guide me the process? Thanks

Reply

Mike Heeren June 7, 2017 at 1:18 pm

Hi Srikanth,

Undeploying via the Maven plugin is unfortunately not supported, so this should be performed manually.

Reply

Srikanth Reddy K June 7, 2017 at 2:22 pm

Thanks for the clarification. Is there any way to include configfile or template file.

Reply

Srikanth Reddy K June 9, 2017 at 7:33 am

Hi Mike, Is this plugin supports customization/template file as an input? I need this option. Could you please include this option if not available. Thanks again.

Reply

Nagaraju Daramukakla June 9, 2017 at 8:21 am

Srikanth,
Yes it is possible and we are using the same by providing the customization file as input and if you would like to know what are the different properties with jar then use the below common to check the different goals and properties

mvn help:describe -DgroupId=nl.whitehorses.servicebus -DartifactId=servicebus-plugin -Dversion=1.1

Hope the above helps you 🙂

Reply

Srikanth Reddy K June 9, 2017 at 8:40 am

Hi Nagaraju Daramukakla, Thanks for the useful information. I have tried this customization/template property in my pom.xml file. But it is not reflecting the changes in sbconsole.

Below is the sample file which consists of required properties.
===============================================

nl.whitehorses.servicebus
servicebus-plugin
1.1

t3://localhost:7001
weblogic
password
${basedir}/../OSBExtensionsCustomizationFile-Template_10.0.0.xml
true
deploy
false
true
${basedir}/target/sbconfig.sbar
true

deploy-assembly
pre-integration-test

deploy-assembly

Though I have given customizationFile property, this plugin is unable to fetch values from file and reflect them in sbconsole. Could you please guide me how to achieve this? Thanks again.

Srikanth Reddy K June 9, 2017 at 8:49 am

Hi Nagaraju Daramukakla, Thanks for the useful information. I have tried this customization/template property in my pom.xml file. But it is not reflecting the changes in sbconsole.

Below is the sample file which consists of required properties.
===============================================

<!–"
nl.whitehorses.servicebus
servicebus-plugin
1.1

t3://localhost:7001
weblogic
password
${basedir}/../OSBExtensionsCustomizationFile-Template_10.0.0.xml
true
deploy
false
true
${basedir}/target/sbconfig.sbar
true

deploy-assembly
pre-integration-test

deploy-assembly

“–>

Though I have given customizationFile property, this plugin is unable to fetch values from a file and reflect them in sbconsole. Could you please guide me how to achieve this? Thanks again.

Srikanth Reddy K June 9, 2017 at 8:54 am

From the above comment, the tag values are not displaying even though I commented out. Those are,

groupId
artifactId
version
configuration
serverUrl
serverUsername
serverPassword
customizationFile
upload
action
remote
verbose
source
usenonexclusivelock
/configuration
executions
execution
id
phase
goals
goal
/goals
/execution
/executions
/plugin

Theses are tags for them. Please take a note… 🙁

Alfonso June 15, 2017 at 6:27 pm

Hi Mike,

Are you sure about this? I t seems to be according to the documentation (https://docs.oracle.com/cd/E24329_01/web.1211/e24443/maven_deployer.htm#DEPGD395)

Reply

Nagaraju Daramukakla June 9, 2017 at 6:06 pm

Srikanht,
If you don’t pass the correct value in customizationFile property it might take default value which i ma not sure, but make you give the correct path, If I have enough time then i will create sample HelloWorldProject and send it to you with pom.xml file with customization file.

Pleas provide your email id.

Reply

Srikanth Reddy K June 15, 2017 at 12:56 pm

Hi Nagaraju/Mike, if possible could you please include UNDEPLOY script to this plugin as well.? Thanks in advance.

Reply

Nagaraju Daramukkala June 21, 2017 at 1:17 am

Hi Srikanth,
Please ping your email here I will send you pom.xml which is working fine for us and it is replacing with values in customization file.

Regards,
Nagaraju

Reply

Srikanth Reddy K June 21, 2017 at 8:39 am

Thanks a lot, Nagaraju. My E-Mail ID: sreeni5877@gmail.com

Thanks, again… 🙂

Reply

Nagaraju Daramukakla June 22, 2017 at 7:49 am

Srikanth,
Sorry for the delay, We are having new issue now and trying to resolve it and then will send you the update pom.xml file and also may be new jar and pom file.

Regards,
Nagaraju

Nagaraju Daramukkala June 23, 2017 at 12:58 am

Srikant,
I have sent you the pom.xml file which has customization file as one of the property.

Regards,
Nagaraju

Nagaraju Daramukkala June 21, 2017 at 9:04 pm

Mike,

Today we saw different issue where we are trying to deploy only one resource which SamplePS.proxy and trying to deploy using maven plugin it is deploying all the resources which are in the customization file.

Can you please help us here.

Reply

Alfredo June 23, 2017 at 12:31 am

Hello, I am working on a SBAR installation with the command: mvn pre-integration-test that succeeds, but the problem occurs to me in the Proxy Definition Service – End Point URI, since it is not able to update the changes it has Any suggestions so that they can be updated.

Reply

Nagaraju Daramukkala June 23, 2017 at 12:57 am

Alfredo,
You have to use the below property in your pom.xml file in order to apply the customization file

./CustomizationFiles/ALSBCustomizationFile_${project.artifactId}_${lifecycle}.xml

Reply

Alfredo June 23, 2017 at 5:27 pm

Many Thanks Nagaraju, I have a doubt when you say to use the property CustomizationFiles inside my file pom.xml only you mean to incorporate it inside the file as a parameter?

Because it also exists that uses the command:
Mvn pre-integration-test -or -DoracleServerUrl = t3: //152.139.146.13: 9001 -DoracleUsername = weblogic -DoraclePassword = welcome1 -Dustomization = / home / usrdmsys / BCH.NEG.TestService / OSBCustomizationFile.xml

And this file I obtained it from the console, according to this page: https://sites.google.com/a/snoopconsulting.com/oracle-service-bus-osb/configuracion/customization-files-1

Reply

Nagaraju Daramukakla June 23, 2017 at 5:36 pm

Alfredo,
Yes thats correct I believe you re using oracle provided Maven file to deploy the code, It should be part of property file, I can send you sample pom.xml file if you still not able to point to it.

Regards,
Nagaraju

Reply

Alfredo June 23, 2017 at 5:40 pm

Thank you for having an example, Thank you.

Alfredo June 23, 2017 at 6:28 pm

Dear, I look forward to your example, thank you in advance.

Alfredo June 23, 2017 at 6:31 pm

My goal is to be able to update the endpoints without having to add a file to the maven commands, the idea is to behave natively as does the Wlst and update them.

Srikanth Reddy Kota October 10, 2017 at 11:46 am

Please provide me / Nagaraju your email-id such that we can able to send the pom.xml file with Customization file included as a parameter.

You can contact me @ sreeni5877@gmail.com

Nagaraju Daramukkala October 9, 2017 at 11:14 pm

Sorry guys for the delay, I got very busy wit my work and could not upload the modified the maven plugin which support RESOURCE based deployment(along with customization file).

@Mike – I have got your code and modified the code to achieve the desired functionality and also let me know how can upload the code and make changes if required(if it is not as per your standards)

Reply

Srikanth Reddy Kota October 22, 2017 at 6:55 am

Hi Nagaraju, Will this plugin works with 12.2.1.3.0 version as well? If not, could you please provide me the updates plugin.?

Reply

Leave a Comment

 

Previous post:

Next post:

About Whitehorses
Company profile
Services
Technology

Whitehorses website

Home page
Whitebooks
Jobs

Follow us
Blog post RSS
Comment RSS
Twitter