I have created spring boot application and tested my project with Rest API call its working fine.I'm applying SSL permission into my RestAPI but its giving exception.Please help me to solve my problem;
Java version: 10.2
Spring boot version:2.0.1
I have used below command to generate keyfile.
keytool -genkey -alias tomcatssl -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 3650
project Structure
application.yml https configuration
While starting my spring boot application I'm getting exception like below:
2019-02-26 17:28:47.726 ERROR 2796 --- [ main] o.apache.catalina.core.StandardService : Failed to start connector [Connector[HTTP/1.1-8082]]
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8082]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:256) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:198) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:300) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) [spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at com.DemoApplication.main(DemoApplication.java:12) [classes/:na]
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1020) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
... 13 common frames omitted
Caused by: java.lang.IllegalArgumentException: keystore password was incorrect
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:116) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:87) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:225) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
... 14 common frames omitted
Caused by: java.io.IOException: keystore password was incorrect
at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2097) ~[na:na]
at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:243) ~[na:na]
at java.base/java.security.KeyStore.load(KeyStore.java:1479) ~[na:na]
at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:139) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:204) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.tomcat.util.net.jsse.JSSEUtil.getKeyManagers(JSSEUtil.java:184) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:114) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
... 19 common frames omitted
Caused by: java.security.UnrecoverableKeyException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
... 26 common frames omitted
2019-02-26 17:28:47.730 INFO 2796 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-02-26 17:28:47.742 INFO 2796 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-02-26 17:28:47.745 ERROR 2796 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
The Tomcat connector configured to listen on port 8082 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector's configuration, identify and stop any process that's listening on port 8082, or configure this application to listen on another port.
2019-02-26 17:28:47.746 INFO 2796 --- [ main] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#112f364d: startup date [Tue Feb 26 17:28:44 IST 2019]; root of context hierarchy
2019-02-26 17:28:47.748 INFO 2796 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2019-02-26 17:28:47.748 INFO 2796 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2019-02-26 17:28:47.749 INFO 2796 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-02-26 17:28:47.749 INFO 2796 --- [ main] com.zaxxer.hikari.HikariDataSource : masterdb-connection-pool - Shutdown initiated...
2019-02-26 17:28:47.755 INFO 2796 --- [ main] com.zaxxer.hikari.HikariDataSource : masterdb-connection-pool - Shutdown completed.
Please help me to resolve the problem.
source link Refernce:
https://code-adda.com/2018/06/enable-https-with-self-signed-certificate-in-spring-boot/
Are you sure that your key-store-password in application.yml is correct and match the password you entered when creating keystore?
SpringBoot version with SSL:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
With this configuration I was able to configure SSL in my project.
server.port=8443
server.ssl.key-alias=tomcatssl
server.ssl.key-password=tomcatssl
server.ssl.key-store=classpath:keystore.jks
server.ssl.key-store-provider=SUN
server.ssl.key-store-type=JKS
I made mistake on keytool generation and I have created with againadmin privilege and its working fine.
I am trying to execute selenium in an Stateless EJB timer service.
The steps made are :
1- I created Stateless EJB service
#Stateless
public class AutomaticSayHello {
private static final Logger logger = Logger.getLogger(AutomaticSayHello.class);
#EJB
private DefaultController defaultController;
#Resource
private TimerService timerService;
#Schedule(hour="*",minute="*/1",persistent=false)
public void automaticHelloService(){
try{
ChromeWrapper chWrapper = ChromeWrapper.getInstance();
chWrapper.get("http:://google.com");
}catch(Exception ex){
logger.info(ex.getMessage());
}
}
}
(In my project I have wrapped ChromeDriver in a class named ChromeWrapper in order to support some shortcut for some methods)
2- Imported existed selenium project in pom.xml file of the ejb project.
<dependencies>
<dependency>
<groupId>com.ozmuzik.remote</groupId>
<artifactId>remote-mobile</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
When I deployed EJB to wildfly 10.1.0 server the maven got the following error:
[INFO] --- wildfly-maven-plugin:1.1.0.Alpha11:deploy (default-cli) # ozmuzik-test-server-ejb ---
Eyl 25, 2016 10:38:59 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.1.Final
Eyl 25, 2016 10:39:00 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.1.Final
Eyl 25, 2016 10:39:00 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.9.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.176 s
[INFO] Finished at: 2016-09-25T10:39:00+03:00
[INFO] Final Memory: 19M/272M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha11:deploy (default-cli) on project ozmuzik-test-server-ejb: Failed to execute goal deploy: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"ozmuzik-test-server-ejb-0.0.1-SNAPSHOT.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"ozmuzik-test-server-ejb-0.0.1-SNAPSHOT.jar\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"ozmuzik-test-server-ejb-0.0.1-SNAPSHOT.jar\"
[ERROR] Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.ozmuzik.test.server.timer.AutomaticSayHello with ClassLoader ModuleClassLoader for Module \"deployment.ozmuzik-test-server-ejb-0.0.1-SNAPSHOT.jar:main\" from Service Module Loader
[ERROR] Caused by: java.lang.NoClassDefFoundError: com/facebook/mobile/selenium/ChromeWrapper
[ERROR] Caused by: java.lang.ClassNotFoundException: com.mobile.selenium.ChromeWrapper from [Module \"deployment.ozmuzik-test-server-ejb-0.0.1-SNAPSHOT.jar:main\" from Service Module Loader]"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"ozmuzik-test-server-ejb-0.0.1-SNAPSHOT.jar\".POST_MODULE"],"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}}}
[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
Any one explain the why this issue is occured ?
I also wonder how I execute some code which are not part of EJB its self?
For simplicity , my aim is to execute a service to crawl some information with selenium with automatic execution of ejb.
I'm not able to build a project using a maven repository on a linux server. I'm using the same repository on my windows pc and I am able to build it.
WARN The POM for com.fasterxml.jackson.core:jackson-databind:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN The POM for com.fasterxml.jackson.core:jackson-core:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
INFO [wsdlgenerator:load-models] Loading models
INFO [wsdlgenerator:load-models] Generating webservices
INFO [wsdlgenerator:perform] Including /apps/visual-rules-6.4.1/server/teamserver/data/VRS_DEFAULT/build/jobs/Master Controller/workspace/IVRS_Common/vr-buildtarget/generated-resources/visual-rules
INFO
INFO --- maven-resources-plugin:2.6:resources (default-resources) # IVRS_Common ---
WARN The POM for org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN The POM for org.apache.maven.shared:maven-filtering:jar:1.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN The POM for org.codehaus.plexus:plexus-interpolation:jar:1.13 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN Error injecting: org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
java.lang.NoClassDefFoundError: Lorg/sonatype/plexus/build/incremental/BuildContext;
maven-filtering:jar:1.1 has a dependency on plexus-container and plexus-interpolation. The missing class is in
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.4</version>
</dependency>
The pom for maven-filtering seems to have the wrong relative path even though it works in windows.
<parent>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
<version>17</version>
<relativePath>../maven-shared-components/pom.xml</relativePath>
</parent>
it should be
../../maven-shared-components/17/maven-shared-components-17.pom
I've looked at some other related questions Why do I get invalid pom due to missing dependency.version although the version is managed? and The POM for <name> is invalid, transitive dependencies (if any) will not be available. I've tried running mvn install in the directory containing the maven-filtering pom and the directory of its parent but I get
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory
I tried executing mvn dependency:tree within these same two directories and I get
[ERROR] [ERROR] Invalid packaging for parent POM org.apache.maven.plugins:maven-dependency-plugin:2.8, must be "pom" but is "maven-plugin"
I went inside the pom for maven-dependency-plugin:2.8 and changed the packaging from maven-plugin to pom and I still get that error. When I make changes to the poms I use this command
mvn deploy:deploy-file -DpomFile=/export/home/user/sonatype-work/nexus/storage/repo/org/apache/maven/shared/maven-filtering/1.1/maven-filtering-1.1.pom \
-Dfile=/export/home/user/sonatype-work/nexus/storage/repo/org/apache/maven/shared/maven-filtering/1.1/maven-filtering-1.1.jar \
-DrepositoryId=repo \
-Durl=http://dendtp102d/nexus/content/repositories/repo
sometimes I just change the pom on the server without executing the deploy command and the changes are reflected when I view the repository in my browser so I'm not sure if it makes a difference.
Edit: Adding more of console output from build
INFO Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14 10:29:23-0700)
INFO Maven home: /apps/visual-rules-6.4.1/tools/apache-maven-3.2.5
INFO Java version: 1.7.0_76, vendor: Oracle Corporation
INFO Java home: /apps/jdk1.7.0_76/jre
INFO Default locale: en_US, platform encoding: UTF-8
INFO OS name: "linux", version: "2.6.32-504.el6.x86_64", arch: "amd64", family: "unix"
INFO Error stacktraces are turned on.
INFO Scanning for projects...
INFO ------------------------------------------------------------------------
INFO Reactor Build Order:
INFO
INFO Common
INFO Controller
INFO Master_Controller
INFO Controller_2
INFO
INFO ------------------------------------------------------------------------
INFO Building Common 0.0.1-SNAPSHOT
INFO ------------------------------------------------------------------------
INFO
INFO --- validation-maven-plugin:6.4.4:validate (default) # Common ---
INFO [validation:prepare] Starting validation
INFO [validation:validateModel] Validating RuleModel 'IVRS_Common'
INFO [validation:final] Validation finished
INFO
INFO --- javagenerator-maven-plugin:6.4.4:generate (default) # Common ---
INFO [vrgenerator:generate] Done
INFO
INFO --- wsgenerator-maven-plugin:6.4.4:generate (default) # Common ---
WARN The POM for com.fasterxml.jackson.core:jackson-databind:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN The POM for com.fasterxml.jackson.core:jackson-core:jar:2.2.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
INFO [wsdlgenerator:load-models] Loading models
INFO [wsdlgenerator:load-models] Generating webservices
INFO [wsdlgenerator:perform] Including /apps/server/teamserver/data/build/jobs/Master Controller/workspace/Common/buildtarget/generated-resources/
INFO
INFO --- maven-resources-plugin:2.6:resources (default-resources) # Common ---
WARN The POM for org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN The POM for org.apache.maven.shared:maven-filtering:jar:1.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN The POM for org.codehaus.plexus:plexus-interpolation:jar:1.13 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
WARN Error injecting: org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering
java.lang.NoClassDefFoundError: Lorg/sonatype/plexus/build/incremental/BuildContext;
Update:
After adding the missing class to the classpath I have this error
Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method "org.sonatype.plexus.build.incremental.BuildContext.newScanner(Ljava/io/File;Z)Lorg/codehaus/plexus/util/Scanner;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, org/apache/maven/shared/filtering/DefaultMavenResourcesFiltering, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, org/sonatype/plexus/build/incremental/BuildContext, have different Class objects for the type xt.newScanner(Ljava/io/File;Z)Lorg/codehaus/plexus/util/Scanner; used in the signature
at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:221)
at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:301)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 14 more
I added <scope>provided</scope> to the plexus-utils dependency in both the maven-filtering pom and the plexus-container-default pom but no resolution for the error
I have sonarqube 3.5.1, and sonar-runner 2.2.1 on a RHEL6.2 server, sonar-runner works fine against the sample data I've downloaded.
However, I've deployed sonar-runner to a windows client, and its failing to connect to the H2 database.
INFO: Sonar Server 3.5.1
11:58:19.960 INFO - Load batch settings
11:58:20.116 INFO - User cache: C:\Users\e01942082\.sonar\cache
11:58:20.132 INFO - Install plugins
11:58:21.739 INFO - ------------- Executing Project Scan
11:58:22.113 INFO - Install JDBC driver
11:58:22.129 INFO - Apply project exclusions
11:58:22.129 WARN - H2 database should be used for evaluation purpose only
11:58:22.129 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 8.393s
Final Memory: 2M/15M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-167])
ERROR: Caused by: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-167]
ERROR: Caused by: Connection refused: connect
So, I've updated the sonar-properties in sonarqube
# Comment the following line to deactivate the default embedded database.
sonar.jdbc.url: jdbc:h2:tcp://gbrpsr000000711.xxxxxxxxx.xxxxxxxxxxx.com:9092/sonar
sonar.jdbc.driverClassName: org.h2.Driver
and sonar-runner conencts to the server with the
sonar.host.url=http://gbrpsr000000711.xxxxxxx.xxxxxxxx.com:9000/sonar
its not clear why its picking up the localhost rather than the full url of the server. Am I missing somehting/ or has this been embedded when I started the service prior to making the config changes????
thanks for you assistance
dD
Built a mavenized mule application as a domain project in anypoint studio. Added munit tests. I can run the munit test suites and all tests complete successfully. I can build and deploy the application when skipping the munit tests (with -DskipMunitTests). However, now I want the build to include the munit tests, but when I remove -DskipMunitTests, I get the following error...
[INFO] Building Mule inventoryService Application 1.0.0-SNAPSHOT
[INFO] --- mule-app-maven-plugin:1.2:attach-test-resources (default-attach-test-resources) # inventoryService ---
[INFO] attaching test resource C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\src\main\app
[INFO] --- build-helper-maven-plugin:1.7:add-resource (add-resource) # inventoryService ---
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # inventoryService ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 6 resources
[INFO] Copying 2 resources
[INFO] skip non existing resourceDirectory C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\mappings
[INFO] --- mule-app-maven-plugin:1.2:filter-resources (default-filter-resources) # inventoryService ---
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # inventoryService ---
[INFO] Nothing to compile - all classes are up to date
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) # inventoryService ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 9 resources
[INFO] Copying 6 resources
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) # inventoryService ---
[INFO] Nothing to compile - all classes are up to date
[INFO] --- maven-surefire-plugin:2.20:test (default-test) # inventoryService ---
[INFO] --- munit-maven-plugin:1.3.4:test (test) # inventoryService ---
[INFO] Acquiring dynamic ports...
[INFO] Dynamic port definition [DONE]
[INFO] Mule working directory set to: C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\target\.mule
[org.mule.munit.remote.RemoteRunner]Run Started
Coverage port: 51497 resources: BCStd-httpListenerConfig.xml,global.xml,interfaces.xml,inventoryService.xml
INFO 2018-02-15 11:40:41,084 [Thread-1] org.mule.munit.plugins.coverage.server.MunitCoverageServer: Waiting for coverage connection
INFO 2018-02-15 11:40:41,099 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ...
INFO 2018-02-15 11:40:41,144 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ...
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/user/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.5/log4j-slf4j-impl-2.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/user/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
INFO 2018-02-15 11:40:41,529 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2018-02-15 11:40:41,674 [main] org.mule.config.spring.MuleDomainContext: Refreshing org.mule.config.spring.MuleDomainContext#335b5620: startup date [Thu Feb 15 11:40:41 CST 2018]; root of context hierarchy
INFO 2018-02-15 11:40:42,969 [main] org.mule.config.spring.processors.ContextExclusiveInjectorProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO 2018-02-15 11:40:43,734 [main] org.mule.util.journal.TransactionJournal: Using files for tx logs C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-tx-log\tx1.log and C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-tx-log\tx2.log
INFO 2018-02-15 11:40:43,749 [main] org.mule.util.journal.TransactionJournal: Using files for tx logs C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-xa-tx-log\tx1.log and C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-xa-tx-log\tx2.log
INFO 2018-02-15 11:40:44,254 [main] org.mule.config.spring.SpringXmlDomainConfigurationBuilder: Configured Mule using "org.mule.config.spring.SpringXmlDomainConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='jar:file:/C:/Users/user/.m2/repository/com/mercury/mulesoft/muledomain/1.0.0-SNAPSHOT/muledomain-1.0.0-SNAPSHOT.zip!/mule-domain-config.xml'}]"
INFO 2018-02-15 11:40:44,254 [main] org.mule.util.queue.QueueXaResourceManager: Starting ResourceManager
INFO 2018-02-15 11:40:44,254 [main] org.mule.util.queue.QueueXaResourceManager: Started ResourceManager
INFO 2018-02-15 11:40:44,294 [main] org.mule.module.http.internal.listener.DefaultHttpListenerConfig: Listening for requests on http://0.0.0.0:8081
INFO 2018-02-15 11:40:44,299 [main] org.mule.DefaultMuleContext:
Mule Runtime and Integration Platform
Version: 3.8.4 Build: 0fc91f08
MuleSoft, Inc.
For more information go to http://www.mulesoft.org
Server started: 2/15/18 11:40 AM
Server ID: id
JDK: 1.8.0_111 (mixed mode)
OS encoding: Cp1252, Mule encoding: UTF-8
OS: Windows 7 - Service Pack 1 (6.1, amd64)
Host: blah (ip)
Agents Running: None
INFO 2018-02-15 11:40:44,349 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2018-02-15 11:40:44,369 [main] org.mule.module.extension.internal.manager.DefaultExtensionManager: Starting discovery of extensions
INFO 2018-02-15 11:40:44,504 [main] org.mule.module.extension.internal.manager.DefaultExtensionManager: Discovered 1 extensions
INFO 2018-02-15 11:40:44,504 [main] org.mule.module.extension.internal.manager.DefaultExtensionManager: Registering extension validation (version 3.8)
INFO 2018-02-15 11:40:44,514 [main] org.mule.munit.runner.spring.config.MunitApplicationContext: Refreshing org.mule.munit.runner.spring.config.MunitApplicationContext#397ef2: startup date [Thu Feb 15 11:40:44 CST 2018]; parent: org.mule.config.spring.MuleDomainContext#335b5620
WARN 2018-02-15 11:40:45,324 [main] org.mule.transport.http.builder.HttpHeaderDefinitionParser: Schema warning: Use of element <header> is deprecated. HTTP transport is deprecated and will be removed in Mule 4.0. Use HTTP module instead..
WARN 2018-02-15 11:40:45,529 [main] org.mule.munit.runner.spring.config.MunitApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Secure_Property_Placeholder': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'key' threw exception; nested exception is java.lang.RuntimeException: Property MULEENC could not be found
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'location' threw exception; nested exception is java.lang.RuntimeException: Property mule.env could not be found
INFO 2018-02-15 11:40:45,549 [main] org.mule.lifecycle.AbstractLifecycleManager: Disposing RegistryBroker
java.lang.RuntimeException: org.mule.api.config.ConfigurationException: Error creating bean with name 'Secure_Property_Placeholder': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'key' threw exception; nested exception is java.lang.RuntimeException: Property MULEENC could not be found
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'location' threw exception; nested exception is java.lang.RuntimeException: Property mule.env could not be found (org.mule.api.lifecycle.InitialisationException)
at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:59)
at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:45)
at org.mule.munit.remote.RemoteRunner.runTestSuite(RemoteRunner.java:75)
at org.mule.munit.remote.RemoteRunner.run(RemoteRunner.java:55)
at org.mule.munit.remote.RemoteRunner.main(RemoteRunner.java:39)
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name 'Secure_Property_Placeholder': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'key' threw exception; nested exception is java.lang.RuntimeException: Property MULEENC could not be found
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'location' threw exception; nested exception is java.lang.RuntimeException: Property mule.env could not be found (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:49)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69)
at org.mule.context.DefaultMuleContextFactory$1.configure(DefaultMuleContextFactory.java:89)
.....
... 4 more
Caused by: org.mule.api.lifecycle.InitialisationException: Error creating bean with name 'Secure_Property_Placeholder': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'key' threw exception; nested exception is java.lang.RuntimeException: Property MULEENC could not be found
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'location' threw exception; nested exception is java.lang.RuntimeException: Property mule.env could not be found
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:112)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:177)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:100)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43)
... 12 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Secure_Property_Placeholder': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'key' threw exception; nested exception is java.lang.RuntimeException: Property MULEENC could not be found
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'location' threw exception; nested exception is java.lang.RuntimeException: Property mule.env could not be found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1512)
.....
... 15 more
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'key' threw exception; nested exception is java.lang.RuntimeException: Property MULEENC could not be found
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'location' threw exception; nested exception is java.lang.RuntimeException: Property mule.env could not be found
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:121)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1508)
... 27 more
INFO 2018-02-15 11:40:45,899 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ...
INFO 2018-02-15 11:40:45,899 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ...
INFO 2018-02-15 11:40:45,909 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2018-02-15 11:40:45,924 [main] org.mule.config.spring.MuleDomainContext: Refreshing org.mule.config.spring.MuleDomainContext#3b95a6db: startup date [Thu Feb 15 11:40:45 CST 2018]; root of context hierarchy
INFO 2018-02-15 11:40:46,094 [main] org.mule.config.spring.processors.ContextExclusiveInjectorProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO 2018-02-15 11:40:46,194 [main] org.mule.util.journal.TransactionJournal: Using files for tx logs C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-tx-log\tx1.log and C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-tx-log\tx2.log
INFO 2018-02-15 11:40:46,199 [main] org.mule.util.journal.TransactionJournal: Using files for tx logs C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-xa-tx-log\tx1.log and C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-xa-tx-log\tx2.log
INFO 2018-02-15 11:40:46,209 [main] org.mule.config.spring.SpringXmlDomainConfigurationBuilder: Configured Mule using "org.mule.config.spring.SpringXmlDomainConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='jar:file:/C:/Users/user/.m2/repository/com/mercury/mulesoft/muledomain/1.0.0-SNAPSHOT/muledomain-1.0.0-SNAPSHOT.zip!/mule-domain-config.xml'}]"
INFO 2018-02-15 11:40:46,209 [main] org.mule.util.queue.QueueXaResourceManager: Starting ResourceManager
INFO 2018-02-15 11:40:46,209 [main] org.mule.util.queue.QueueXaResourceManager: Started ResourceManager
[org.mule.munit.remote.CoverageManager]Calculating application coverage for resources: BCStd-httpListenerConfig.xml,global.xml,interfaces.xml,inventoryService.xml
java.lang.RuntimeException: org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "start" on object: org.mule.module.http.internal.listener.DefaultHttpListenerConfig#73613ae5
at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:59)
at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:45)
at org.mule.munit.remote.RemoteRunner.runTestSuite(RemoteRunner.java:75)
at org.mule.munit.remote.RemoteRunner.run(RemoteRunner.java:55)
at org.mule.munit.remote.RemoteRunner.main(RemoteRunner.java:39)
Caused by: org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "start" on object: org.mule.module.http.internal.listener.DefaultHttpListenerConfig#73613ae5
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:249)
at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:99)
at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:71)
.....
... 4 more
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
.....
... 20 more
INFO 2018-02-15 11:40:46,234 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ...
INFO 2018-02-15 11:40:46,239 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ...
INFO 2018-02-15 11:40:46,244 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2018-02-15 11:40:46,254 [main] org.mule.config.spring.MuleDomainContext: Refreshing org.mule.config.spring.MuleDomainContext#29fe4840: startup date [Thu Feb 15 11:40:46 CST 2018]; root of context hierarchy
INFO 2018-02-15 11:40:46,439 [main] org.mule.config.spring.processors.ContextExclusiveInjectorProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO 2018-02-15 11:40:46,529 [main] org.mule.util.journal.TransactionJournal: Using files for tx logs C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-tx-log\tx1.log and C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-tx-log\tx2.log
INFO 2018-02-15 11:40:46,529 [main] org.mule.util.journal.TransactionJournal: Using files for tx logs C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-xa-tx-log\tx1.log and C:\Users\user\AnypointStudio\BPMtoMulesoft\inventoryService\.\.mule\queue-xa-tx-log\tx2.log
INFO 2018-02-15 11:40:46,559 [main] org.mule.config.spring.SpringXmlDomainConfigurationBuilder: Configured Mule using "org.mule.config.spring.SpringXmlDomainConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='jar:file:/C:/Users/user/.m2/repository/com/mercury/mulesoft/muledomain/1.0.0-SNAPSHOT/muledomain-1.0.0-SNAPSHOT.zip!/mule-domain-config.xml'}]"
INFO 2018-02-15 11:40:46,559 [main] org.mule.util.queue.QueueXaResourceManager: Starting ResourceManager
INFO 2018-02-15 11:40:46,559 [main] org.mule.util.queue.QueueXaResourceManager: Started ResourceManager
[org.mule.munit.remote.CoverageManager]Coverage report calculation failed -
java.lang.RuntimeException: org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "start" on object: org.mule.module.http.internal.listener.DefaultHttpListenerConfig#68b7d0ef
at org.mule.munit.runner.simple.MunitSimpleRunner.run(MunitSimpleRunner.java:54)
at org.mule.munit.remote.path.ApplicationPathBuilder.buildApplicationPaths(ApplicationPathBuilder.java:80)
at org.mule.munit.remote.path.ApplicationPathBuilder.getFlowPaths(ApplicationPathBuilder.java:41)
.....
Caused by: org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "start" on object: org.mule.module.http.internal.listener.DefaultHttpListenerConfig#68b7d0ef
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:249)
at org.mule.lifecycle.RegistryLifecycleCallback.doApplyLifecycle(RegistryLifecycleCallback.java:99)
at org.mule.lifecycle.RegistryLifecycleCallback.onTransition(RegistryLifecycleCallback.java:71)
.....
... 6 more
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
.....
... 22 more
[org.mule.munit.remote.RemoteRunner]Done
[INFO] Printing Coverage Report...
[INFO]
[INFO] MUnit Coverage Summary
[INFO]
[INFO] * Resources: 0 - Flows: 0 - Message Processors: 0
[INFO] * Application Coverage: N/A
[INFO]
[INFO] MUnit Run Summary
[INFO]
[INFO] >> inventoryService-apikit-test.xml test result: Tests: 0, Errors: 0, Failures:0, Skipped: 0 <<< ERROR
[INFO] >> inventoryService-apikit-exception-test.xml test result: Tests: 0, Errors: 0, Failures:0, Skipped: 0 <<< ERROR
[INFO]
[INFO] > Tests: 0
[INFO] > Errors: 0
[INFO] > Failures: 0
[INFO] > Skipped: 0
[INFO]
[INFO] BUILD FAILURE
[INFO] Total time: 11.421 s
[INFO] Finished at: 2018-02-15T11:40:47-06:00
[INFO] Final Memory: 27M/266M
[INFO]
[ERROR] Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.3.4:test (test) on project inventoryService: Build Fail: MUnit Tests Failed -> [Help 1]
[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] 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
[INFO] Scanning for projects...
[INFO]
[INFO] Building Domain muledomain Project 1.0.0-SNAPSHOT
[INFO]
[INFO] --- mule-domain-maven-plugin:1.2:attach-test-resources (default-attach-test-resources) # muledomain ---
[INFO] attaching test resource C:\Users\user\AnypointStudio\BPMtoMulesoft\muledomain\src\main\app
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # muledomain ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] --- mule-domain-maven-plugin:1.2:filter-resources (default-filter-resources) # muledomain ---
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # muledomain
[INFO] No sources to compile
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) # muledomain ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\user\AnypointStudio\BPMtoMulesoft\muledomain\src\test\resources
[INFO] skip non existing resourceDirectory C:\Users\user\AnypointStudio\BPMtoMulesoft\muledomain\src\main\app
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) # muledomain ---
[INFO] No sources to compile
[INFO] --- maven-surefire-plugin:2.20:test (default-test) # muledomain ---
[INFO] No tests to run.
[INFO]
[INFO] BUILD SUCCESS
[INFO]
[INFO] Total time: 1.770 s
[INFO] Finished at: 2018-02-15T11:40:50-06:00
[INFO] Final Memory: 12M/145M
[INFO]
... I have spent a good amount of time researching the errors, but much of what I've found that others had was missing dependencies, which I seem to already have in my pom file.
What could be the issue? Any suggestions appreciated.
Based on the log you provided, I observed 2 main errors:
#1
nested exception is java.lang.RuntimeException: Property mule.env could not be found
Solution: cross check whether you have configured mule.env=dev based on your environment(dev/test/prod).
#2
Caused by: java.net.BindException: Address already in use: bind
Solution: If you are using multiple HTTP connectors with the same port number, or if you are using a port which is occupied by some other s/w in your system then you will get this BindException. Try a different port number, e.g. 2018.
<munit:config name="munit" doc:name="MUnit configuration" mock-connectors="false" mock-inbounds="false" />
please update you Munit XML with above line, it should work!!