IntelliJ Process finished with exit code 0 when spring-boot run - java

I have a problem when starting spring-boot appication from IntelliJ-Idea. I don't have this problem when running application through terminal.
:: Spring Boot :: (v1.2.1.RELEASE)
2015-09-24 12:22:44.274 WARN 22380 --- [ main] n.sf.ehcache.config.CacheConfiguration : Cache 'publicationsCount' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'publicationsCount' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
Process finished with exit code 0
I think this warn is not causing it. What may be the reason?

Deleting provided scope of spring-boot-starter-tomcat dependency helps me.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

I create a simple project from https://start.spring.io/ (sprint initializr) and added a simple controller to run the application.
#RestController
public class testController {
#GetMapping(value="/")
//#RequestMapping(value="/",method=RequestMethod.GET)
public String hello(){
return "Hello World!!";
}
}
but it wasn't getting started because my pom wasn't having
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
After adding this my application started...
2019-11-05 14:33:32.302 INFO 39079 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#dd20ebc, org.springframework.security.web.context.SecurityContextPersistenceFilter#57b1ec84, org.springframework.security.web.header.HeaderWriterFilter#2c2a7d53, org.springframework.security.web.csrf.CsrfFilter#b9b97ad, org.springframework.security.web.authentication.logout.LogoutFilter#29f3185c, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#4ffa7041, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#2c2a903f, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#6c70b7c3, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#48d44b46, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#5cbe95b1, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#11ad095c, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#16a09809, org.springframework.security.web.session.SessionManagementFilter#1de85972, org.springframework.security.web.access.ExceptionTranslationFilter#4a122e68, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#5d37aa0f]
2019-11-05 14:33:32.392 INFO 39079 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-05 14:33:32.398 INFO 39079 --- [ main] eModelDeploymentServiceParentApplication : Started ServiceModelDeploymentServiceParentApplication in 5.727 seconds (JVM running for 6.778)
Here are my pom dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Note: You may be not needing all the dependencies above.

Adding spring boot starter web solved my problem
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

Add the below dependencies in pom.xml :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>test</scope>
</dependency>

If you create a project gradle template from https://start.spring.io/ (sprint initializr), you need to add org.springframework.boot:spring-boot-starter-web dependecy in you build.gradle file.
// you need to add this dependency to run spring boot correctly
implementation 'org.springframework.boot:spring-boot-starter-web'

Using the below dependencies in pom.xml, as well as loading maven changes (ctrl+shift+o) solved my problem.
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

in my case i started intelliJ as
adminstrator
, then it works
make sure you have tomcat dependency
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version>
</dependency>

In my case, there is a slight difference between:
Just click Run in the most visible bottom inside IntelliJ and...
Look for the default controller inside src/main/java/com.exampler.yourapplication, right click and press Run there.
The second option just run the project properly.

If below property was added to the allication.properties file, need to remove this.
This property is used to remove the web container.
spring.main.web-application-type=none
In my case I forgot to remove this and once it's removed the issue was fixed

In my case, I need to remove several dependencies first. Then I run maven clean. After that my code just works fine.

Related

Spring boot 2.2 activemq jetty conflict

I am trying to upgrade Spring boot to the version 2.2 together with jetty starter.
I get these errors due to jetty version conflict
The following method did not exist:
'org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer.initialize(org.eclipse.jetty.servlet.ServletContextHandler)'
The method's class, org.eclipse.jetty.websocket.server.NativeWebSocketServletContainerInitializer, is available from the following locations:
jar:file:/some-dir/target/p3.0.166-SNAPSHOT.war!/WEB-INF/lib/jetty-all-9.4.19.v20190610-uber.jar!/org/eclipse/jetty/websocket/server/NativeWebSocketServletContainerInitializer.class
jar:file:/some-dir/target/p3.0.166-SNAPSHOT.war!/WEB-INF/lib/websocket-server-9.4.20.v20190813.jar!/org/eclipse/jetty/websocket/server/NativeWebSocketServletContainerInitializer.class
I have activemq dependency which brings in it's own jetty-all versioned 9.4.19 dependency which is in conflict with spring-boot 2.2 jetty (9.4.20)
And part of my pom.xml is:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--
Jsp-api isn't standard in spring boot
-->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- artefacts enable JSP running in spring-boot -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jsp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jstl</artifactId>
</dependency>
<!--
Used to be a single artifact.
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
Newer versions splits the interface and implementation.
This suggests to use a Glassfish implementation.
https://www.andygibson.net/blog/quickbyte/jstl-missing-from-maven-repositories/
The one we used had an Apache implementation, so going with that.
https://stackoverflow.com/a/24444342
-->
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<version>${taglibs.version}</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>${taglibs.version}</version>
</dependency>
<!-- Unit test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<!-- html compressing is used by hrmanager in the JSP -->
<dependency>
<groupId>com.googlecode.htmlcompressor</groupId>
<artifactId>htmlcompressor</artifactId>
<version>1.5.2</version>
</dependency>
<!-- ApacheMQ HTTP jarfile set -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-http</artifactId>
</dependency>
</dependencies>
Any idea how I can fix this?
ActiveMQ is wrong here.
jetty-all is not meant to be used as a dependency in a project.
See https://www.eclipse.org/lists/jetty-users/msg06030.html
It only exists as a command line tool for the documentation to educate folks about basic featureset of Jetty.
It does not, and cannot, contain all of Jetty.
A single artifact with everything that Jetty produces is impossible.
As #Shilan pointed out, excluding jetty-all is the correct solution.
The use of the other appropriate dependencies (by spring-boot-starter-jetty it seems) will already pull in the correct Jetty transitive dependencies that you need.
You can use $ mvn dependency:tree from the command line to see this (before and after excluding jetty-all)
You might want to run one of the duplicate class finder maven plugins to see what other duplicate classes you have going on and correct for those as well.
https://github.com/ning/maven-duplicate-finder-plugin
https://github.com/basepom/duplicate-finder-maven-plugin

Can't see internal logs of Spring Boot app in $CATALINA_HOME/logs/localhost*.log

It's the second day I'm trying to find internal logs of my application. I've tried different approaches but none works.
What I have:
The application is run on Google cloud (maybe it makes scence)
Java 12
Spring Boot 2.1.7.RELEASE
Tomcat 9
How I am logging:
Firstly, I've tried simply use Lombok and its #Log4j2. I couldn't see any log in $CATALINA_HOME/logs/localhost.*.log.
Then I found several questions on stackoverflow. There is said that I need exclude spring-boot-starter-logging from pom.xml and add spring-boot-starter-log4j2. It didn't work, as well...
The third option was to use Slf4j. The same results :c
However, when I start the app via Intellij, Everything is logged. And what seems to me strange is when I type service tomcat9 status on the VM, I can see a bit of logs like part of Spring banner.
Here is dependencies from my pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
UPD:
The forth variant: as above, I added exclusions to pom.xml AND created log4j2.xml, where I specified log file.

(spring, micrometer+prometheus) NoSuchMethodError - AbstractTimer.<init>

I've been scratching my head on this one for a while. I have this error that's trickling out of my endpoint behind my JSON.
Raw JSON comes out with this message at the end of it for every request:
[{"xd":"0"}]{"error":"OK","message":"io.micrometer.core.instrument.AbstractTimer.<init>(Lio/micrometer/core/instrument/Meter$Id;Lio/micrometer/core/instrument/Clock;Lio/micrometer/core/instrument/distribution/DistributionStatisticConfig;Lio/micrometer/core/instrument/distribution/pause/PauseDetector;Ljava/util/concurrent/TimeUnit;Z)V","path":"/avgSpeed","status":200,"timestamp":"2018-06-21T16:40:31.639+0000"}
I have a springboot app setup for monitoring with prometheus... I used this template on another project and it's not giving me any problems. I'm not sure what changed.
I honestly don't know what to do to debug this type of thing...
Here's a partial stack trace (it's very long, can include the whole thing on request).
[http-nio-8080-exec-2] default 2018-06-21 12:40:31,634 ERROR o.a.c.c.C.[.[.[.[dispatcherServlet]:182 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Filter execution threw an exception] with root cause
java.lang.NoSuchMethodError: io.micrometer.core.instrument.AbstractTimer.(Lio/micrometer/core/instrument/Meter$Id;Lio/micrometer/core/instrument/Clock;Lio/micrometer/core/instrument/distribution/DistributionStatisticConfig;Lio/micrometer/core/instrument/distribution/pause/PauseDetector;Ljava/util/concurrent/TimeUnit;Z)V
at io.micrometer.prometheus.PrometheusTimer.(PrometheusTimer.java:40)
at io.micrometer.prometheus.PrometheusMeterRegistry.newTimer(PrometheusMeterRegistry.java:161)
at io.micrometer.core.instrument.MeterRegistry.lambda$timer$2(MeterRegistry.java:255)
at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:561)
at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:537)
at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:253)
at io.micrometer.core.instrument.Timer$Builder.register(Timer.java:420)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.stop(WebMvcMetricsFilter.java:237)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.record(WebMvcMetricsFilter.java:228)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:166)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:126)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:111)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
These are my dependencies:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.0.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.2</version>
</dependency>
<!-- json utilities -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- for exposing endpoints / prometheus+grafana container -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.0.5</version>
</dependency>
<!-- for logback evaluator -->
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>3.0.8</version>
</dependency>
</dependencies>
I don't know how this got changed, but I noticed my companion service was using 2.0.2.RELEASE for spring-boot-starter-actuator and 1.0.4 for micrometer-registry-prometheus.
I changed my pom to match those versions and the issue vanished.
False alarm, sorry!

SpringBoot 1.5.x not writing to file at logging.file

I have a service that has loggers in a lot of places like this
private static final Logger LOGGER =
LoggerFactory.getLogger(myclass.class);
These loggers are writing to my console but are not writing to the file I specified in my application.properties file like this
logging.file=my-service.log
my pom.xml file
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc</artifactId>
<version>4.2</version>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt-spring31</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>
<dependency>
<groupId>com.maxmind.geoip</groupId>
<artifactId>geoip-api</artifactId>
<version>1.3.1</version>
</dependency>
<!-- AWS Dependencies -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-actuator</artifactId>
</dependency>
<!-- END of AWS Dependencies -->
I have tried adding my own logback-spring.xml file that only writes to a file and that seems to only stop the the printing to the console but still it doesn't write to the file. Described here Spring Boot - no log file written (logging.file is not respected)
I have stepped through the code and noticed that the LoggingSystem class is setting the properties correctly. Also if I exclude starter-logging dependency like this
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
then the service log file is created but by the internal Java handler and it's in the wrong format. I want to use the Spring one because it can show more info when setting the log level to TRACE or DEBUG.
Has anyone else seen this problem and know how to make Spring write the service logs to that filed specified?
UPDATE
It seems the issue is coming from these dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
It seems any springframework.cloud dependency will cause the project to not create the logging.file file.
I found the problem and the solution.
I needed to put the logging properties like
logging.file=my-service.log
in a bootstrap.properties file. This file should be places in the resources directory where the application.properties file is.
It seems that when using the springframework.cloud dependency BootstrapApplicationListener is called first to initialize LogbackLoggingSystem class. Then since those properties are initialized then the application ignores them in the application.properties file.
More here https://github.com/spring-projects/spring-boot/issues/7099

Spring boot with websphere configuration classes not working

I am getting below error when running the app with springboot tomcat. The below error message is repeating continuously. Please help.
2015-09-22 03:37:09.477 ERROR 20112 --- [ main]
c.i.w.naming.java.javaURLContextFactory : NMSV0307E: A java: URL name
was used, b ut Naming was not configured to handle java: URL names.
The likely cause is a user in error attempting to specify a java: URL
name in a non- J2EE client or server environment. Throwing
ConfigurationException.
Dependencies
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.aredis</groupId>
<artifactId>aredis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<!-- <version>1.2.16</version> -->
</dependency>
<dependency>
<groupId>net.sf.joesnmp</groupId>
<artifactId>joesnmp</artifactId>
<version>0.3.4</version>
</dependency>
<dependency>
<groupId>com.ibm.ws.admin</groupId>
<artifactId>adminClient</artifactId>
<version>8.5.0</version>
</dependency>
<dependency>
<groupId>com.ibm.ws.runtime</groupId>
<artifactId>ibmRuntime</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.ibm.websphere</groupId>
<artifactId>ibmorb</artifactId>
<version>8.5</version>
</dependency>
<dependency>
<groupId>com.ibm.websphere</groupId>
<artifactId>ibmorbapi</artifactId>
<version>8.5</version>
</dependency>
<dependency>
<groupId>com.ibm.websphere</groupId>
<artifactId>orb</artifactId>
<version>8.5</version>
</dependency>
</dependencies>
<properties>
<start-class>com.springboot.main.ConfigInitializer</start-class>
<jersey-version>1.5</jersey-version>
</properties>
On Spring Boot v1.5.6.RELEASE I had to do this to load WebSphere classes on the classpath:
/src/main/resources/application.properties:
spring.jmx.enabled=false
/src/main/resources/spring.properties:
spring.jndi.ignore=true

Categories