Spring Initializr pane is blank in IntellJ, for both New Project and New Module - spring

In Intellij, the Spring initializr option is available, but the pane where the options for adding dependencies reside is blank. I tried upgrading my IDE to no avail. This is true when either creating a new project or a new module. This was not an issue until my work issued me a PowerMac (was on Windows before).
When I try to access Initializr, idea.log shows the following stacktrace:
2019-02-12 13:52:16,116 [7322253] ERROR - plication.impl.ApplicationImpl - java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1488)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3018)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:489)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:609)
at com.intellij.util.io.HttpRequests.access$300(HttpRequests.java:59)
at com.intellij.util.io.HttpRequests$RequestImpl.getConnection(HttpRequests.java:378)
at com.intellij.util.io.HttpRequests$RequestImpl.getInputStream(HttpRequests.java:387)
at com.intellij.util.io.HttpRequests$RequestImpl.getReader(HttpRequests.java:405)
at com.intellij.spring.boot.initializr.SpringInitializrOptionsLoader$1.process(SpringInitializrOptionsLoader.java:104)
at com.intellij.spring.boot.initializr.SpringInitializrOptionsLoader$1.process(SpringInitializrOptionsLoader.java:97)
at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:523)
at com.intellij.util.io.HttpRequests.process(HttpRequests.java:499)
at com.intellij.util.io.HttpRequests.access$100(HttpRequests.java:59)
at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:352)
at com.intellij.spring.boot.initializr.SpringInitializrOptionsLoader.loadOptions(SpringInitializrOptionsLoader.java:97)
at com.intellij.spring.boot.initializr.SpringInitializrApplicationInfoStep.lambda$loadSpringInitializrOptions$3(SpringInitializrApplicationInfoStep.java:151)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.sun.security.ntlm.Client.type3(Client.java:161)
at sun.net.www.protocol.http.ntlm.NTLMAuthentication.buildType3Msg(NTLMAuthentication.java:241)
at sun.net.www.protocol.http.ntlm.NTLMAuthentication.setHeaders(NTLMAuthentication.java:216)
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2096)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
... 20 more
How can I fix this?

It looks like a Java bug specific to your NTLM proxy.
It may help if you use IntelliJ IDEA 2019.1 EAP version with JetBrains Runtime 11 version where this issue should be fixed.

Related

java.lang.NoClassDefFoundError in firebase admin

I have log4j in spring boot project which uses firebase admin
Randomly firebase admin threw this error even if it is not in use.
Exception in thread "firebase-database-worker" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.error(Logger.java:538)
at com.google.firebase.database.core.JvmPlatform$1.handleException(JvmPlatform.java:57)
at com.google.firebase.database.utilities.DefaultRunLoop.handleExceptionInternal(DefaultRunLoop.java:102)
at com.google.firebase.database.utilities.DefaultRunLoop.access$000(DefaultRunLoop.java:34)
at com.google.firebase.database.utilities.DefaultRunLoop$1.afterExecute(DefaultRunLoop.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2022-08-13 22:27:22,729 INFO [http-nio-9658-exec-190]
It seems like it needs a different log library, and when I tried to install ch/qos
The project won't work. unless I removed it from the pom.xml
Does anyone have a solution?
i don't want to change my log library as I can't replace firebase now

Spring Throws NoSuchMethodError Exception

When I'm trying to run the below code
#Override
public List<EventDetails> process(int event_status) throws EventDetailDataException {
String sql="select * from MicroServiceEventDetails where event_status=?";
List<EventDetails> EventDetailsList = template.query(sql, new BeanPropertyRowMapper<EventDetails>(EventDetails.class),new Object[] {event_status});
return EventDetailsList;
}
It throws the following exception and here's the error log:-
Apr 02, 2017 6:26:04 AM org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler handleError
SEVERE: Unexpected error occurred in scheduled task.
java.lang.NoSuchMethodError: org.springframework.core.convert.support.DefaultConversionService.getSharedInstance()Lorg/springframework/core/convert/ConversionService;
at org.springframework.jdbc.core.BeanPropertyRowMapper.<init>(BeanPropertyRowMapper.java:91)
at com.syntel.boot.dao.EventProcessDaoImpl.process(EventProcessDaoImpl.java:38)
at com.syntel.boot.services.EventDetailServiceImpl.process(EventDetailServiceImpl.java:73)
at com.syntel.boot.scheduler.microeventschudler.eventExcuter(microeventschudler.java:30)
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.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Maybe maven dependencies would be the reason i'm not sure, help?
I assume you are using Maven/Gradle, any build tool.
I was working on a spring MVC project and added LDAP functionality, however I added the LDAP jar dependency on the top of the dependency list in pom.xml and the jar version I used, utilized a lower version of spring core which did not have the ConversionService class. I identified this by back tracking to what was the most recent change to the Spring jar versions I made(i.e. added ldap libs) and using the Maven - Dependency hierarchy tab to identify what had changed. Once I removed the new dependency. did a clean, install, add the dependencies to the bottom of the list. The issue was fixed.
Your resolved dependencies should have the highest spring core version referenced on the column on the left. Any lower version should be omitted. In the screenshot, notice that spring core 4.3.9 is omitted for 4.3.4. Avoid this by adding the dependencies that use lower spring core versions below those which use higher versions.

ReflectionUtils.makeAccessible() in different .jar files lead to java.lang.NoSuchMethodError Exception on openJDK

i have the following problem: we raised our application from java6 with tomcat6 to java8 with tomcat8. Starting the application on our local machines with Oracle Java 8 worked witouth problem. But on our server we get
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:125)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
We investigated the problem and the ReflectionUtils.makeAccessible() Method is provided by spring-core-2.0.8.jar and org.springframework.core-3.0.4.RELEASE.jar
Our server is running OpenJDK 8 instead of Oracle Java 8 and it seems like the application tries to use makeAccessible() from the spring-core-2.0.8.jar instead of the org.springframework.core-3.0.4.RELEASE.jar. When we delete the spring-core-2.0.8.jar in our lib Folder the application starts without a problem. Unfortunately the spring-core-2.0.8.jar comes as a maven transitive dependency from a maven hibernate dependency, therefore we need this jar.
Do you have any ideas how to solve this?
Thanks in advance, best regards

Unable to find data for class 'org/springframework/boot/context/web/SpringBootServletInitializer'

I am getting this strange error while trying to start Spring Boot application in Servlet container.
The same WAR starts normally in standalone Tomcat server, but gives the error seen below if started using Gretty Gradle plugin
Any ideas that it means?
Spring-boot 1.3.3, Gradle 2.12, Gretty 1.2.4, Tomcat 8
java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:104)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
...
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5066)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springsource.loaded.UnableToLoadClassException: Unable to find data for class 'org/springframework/boot/context/web/SpringBootServletInitializer'
at org.springsource.loaded.Utils.loadSlashedClassAsBytes(Utils.java:787)
at org.springsource.loaded.TypeRegistry.getDescriptorFor(TypeRegistry.java:311)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.getTypeDescriptorFor(TypeDescriptorExtractor.java:124)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.findTypeDescriptor(TypeDescriptorExtractor.java:140)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.walkHierarchyForCatchersAndSuperDispatchers(TypeDescriptorExtractor.java:152)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.computeCatchersAndSuperdispatchers(TypeDescriptorExtractor.java:219)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.getTypeDescriptor(TypeDescriptorExtractor.java:81)
at org.sprce.loaded.TypeDescriptorExtractor.extract(TypeDescriptorExtractor.java:51)
at org.springsource.loaded.TypeRegistry.addType(TypeRegistry.java:912)
at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:302)
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
... 42 more
Apparently there is a bug in Gretty related to classloading.
Starting Gretty with WAR e.g. gradlew appRunWar allows to work around it.
There are multiple bugs opened for it:
https://github.com/akhikhl/gretty/issues/199
https://github.com/akhikhl/gretty/issues/209
https://github.com/akhikhl/gretty/issues/148

Spring Boot Using No Longer Supported Version Of BouncyCastle (through CrashHub)

Spring boot is using an older version of CrashHub (crashub.version in POM) that uses an old version of bouncycastle that using the class PemReader. This conflicts with the latest version of bouncycastle I am using in my application. Can you update Spring Boot or is there a work around I can do. Right now I get the exception below when I try to ssh into my application:
java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PEMReader
at org.crsh.ssh.term.URLKeyPairProvider.loadKeys(URLKeyPairProvider.java:54)
at org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.getKeyTypes(AbstractKeyPairProvider.java:53)
at org.apache.sshd.server.session.ServerSession.sendKexInit(ServerSession.java:127)
at org.apache.sshd.server.session.ServerSession.<init>(ServerSession.java:60)
at org.apache.sshd.server.session.SessionFactory.doCreateSession(SessionFactory.java:43)
at org.apache.sshd.common.session.AbstractSessionFactory.createSession(AbstractSessionFactory.java:38)
at org.apache.sshd.common.AbstractSessionIoHandler.sessionCreated(AbstractSessionIoHandler.java:36)
at org.apache.sshd.common.io.nio2.Nio2Acceptor$AcceptCompletionHandler.completed(Nio2Acceptor.java:128)
at org.apache.sshd.common.io.nio2.Nio2Acceptor$AcceptCompletionHandler.completed(Nio2Acceptor.java:109)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.openssl.PEMReader
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:170)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:136)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 15 common frames omitted
1.3.0 is the latest version of Crashub and that's the version that Spring Boot supports so there's nothing that can be done on the Spring Boot side of things. Assuming that you don't want to downgrade your Bouncycastle dependency, your only easy choice is to stop using Crashub.
A more involved alternative would be to fork Crashub and make the changes necessary for it to work with your desired version of Bouncycastle.

Resources