Win a copy of Rust Web Development this week in the Other Languages forum!

Mohammed Sardar.

Ranch Hand
+ Follow
since Jun 22, 2014
Mohammed likes ...
jQuery Spring Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt Green check

Recent posts by Mohammed Sardar.

Hi All,

Happy new year greetings. I'm looking out for some help in rendering the UML diagram through the installed plugin PlantUML. I was able to view the UML for some time, now I see only the blank page prolong. I tried to follow the performance tips too which didn't help at least. I ensured the below screenshot settings in the plantUML settings window is fine. Cleared cache, restarted the IDE, tried to create a new plantUML and it went fine. Either I'm unable to see the UML code too to place the cursor between the @startuml and @enduml. If anyone can help with what is missed in the settings or configuration, will be much helpful.
1 week ago
I'm curious to know, how Oracle notifies its subscribers about the removal of the javax.xml.bind(JAXB) module since Java 11. Doesn't this break existing functionalities of the JAXB-based code already implemented? So, whoever using JAXB needs to download and add as a separate dependency whenever reading the release notes from the Oracle team? Also, what is the intention making to remove and separate from Java? I'm seeing this from the technical perspective.  
1 week ago
I'm able to import the dependency after including it in the respective sub-module instead of root pom. I thought the dependency would be inherited from root pom but that didn't work.  I still need to understand why is it so. How the root pom dependencies can be reused in another sub-module pom?
1 week ago
Sharing some more lengthy stack traces for better understanding. some of the package names are masked due to security reason.

Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [$$EnhancerBySpringCGLIB$$b11914e9]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
2022-01-09T13:08:45.562+05:30 ERROR [org-payments,,,] 4880 --- [TraceId:] [UserId:] [UserScope:] [           main] o.s.b.SpringApplication                  : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kafkaConfiguration'
payments/api/config/KafkaConfiguration.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
at ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE]
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>( ~[jackson-module-jaxb-annotations-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>( ~[jackson-module-jaxb-annotations-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule.setupModule( ~[jackson-module-jaxb-annotations-2.9.10.jar:2.9.10]
at com.fasterxml.jackson.databind.ObjectMapper.registerModule( ~[jackson-databind-]
at com.fasterxml.jackson.databind.ObjectMapper.registerModules( ~[jackson-databind-]
at com.fasterxml.jackson.databind.ObjectMapper.findAndRegisterModules( ~[jackson-databind-]
at com.xxxx.core.messaging.spring.kafka.AbstractKafkaConfiguration.<init>( ~[spring-kafka-support-2.12.0.jar:2.12.0]
at com.xxxx.orc.payments.api.config.KafkaConfiguration.<init>( ~[classes/:na]
at com.yyyy.orc.payments.api.config.KafkaConfiguration$$EnhancerBySpringCGLIB$$b11914e9.<init>(<generated>) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance( ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance( ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance( ~[na:an]
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlElement
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass( ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[na:na]
at java.base/java.lang.ClassLoader.loadClass( ~[na:na]
... 43 common frames omitted

1 week ago
Thanks all for sharing throughts and link. For some unknown reason, I couldn't download the below dependency either from nexus or from maven repos. I ensured I follow the proper URL in the .m2 folder settings.xml. After spending some long hours, manually downloaded the below jar and added it to the local maven repo. Then tried to execute the application but still ended up with the error.  The screenshot shows, manually added XML. bind dependency to the external library. Maven build was a success. Do we have any debugging techniques to reach the root cause of the issue? Any issue in dependency setup?

I observe looks something different from the shown error in the link. Actually, I'm getting Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>( ~[jackson-module-jaxb-annotations-2.9.10.jar:2.9.10]

1 week ago
Hi All,

We upgraded one of the spring boot-based microservice to Java 11 from 8. Post-up-gradation facing some issue with KafkaConfiguration bean initialization issue. Maven build is getting success, but when trying to execute the application facing the below error stack trace. The Kafka version used is kafka_2.13-2.7.0 and ensured that Java 11 is installed as Java_home with echo $JAVA_VERSION.mohammedsardar$ echo $JAVA_HOME/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>( ~[jackson-module-jaxb-annotations-2.9.10.jar:2.9.10]

Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlElement
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass( ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass( ~[na:an]

Anyone has seen this issue before? Any idea will really help me a lot.  Thanks.
2 weeks ago

Tim Holloway wrote:You are confusing the Amazon Control Panel server with your Amazon instance. They are two different servers with 2 different IP addresses.

The Control panel app belongs to Amazon and doesn't run on the same VM as your AWS instance does or even the same subnet. The firewall to their server is open, since otherwise you wouldn't be able to talk to the control panel app. But the Amazon firewall to your server is not open and you need to use the Amazon Control Panel app to change that.

Good to know that I'm confused about amazon's control panel and amazon instances, and I believe that will get clarity by exploring them. I'm trying to access the control panel (ACP) after reading the document below. - when I try to access this as per the URL signature specified in the document and am unable to access in return getting We can’t connect to the server at

And still looking at why I don't have access to amazon CCP but ensured the instance name specified here is the correct one. am I on right track? Is this what you mean? Thanks for your great time.
2 months ago
Created new inbound rules for the HTTP:80 port and relaunched the ec2 instance and still in the same situation ...

I'm unable to add more attachments to this post since getting "The total size of the attachments should not be greater than 1,024 kb. The uploaded files have a total of 1,039 kb.".

2 months ago

Tim Holloway wrote:Yes, you absolutely must open up Amazon's firewall. As I said, your browser probably already was set up that way because outbound traffic is rarely firewalled. But traffic inbound to Amazon's public IP address does have to be enabled via the Amazon control panel app. The default is to forbid it.

Again, I cannot see any ports on and that includes the SSH port, so I have to question if your screenshot is current because I'm virtually certain that either the machine is down or you're not even able to connect to it via SSH, much less the web port.

But traffic inbound to Amazon's public IP address does have to be enabled via the Amazon control panel app. The default is to forbid it. - You mean the firewall to be switched off on the AWS EC2 instance? Am I correct?

This screenshot was taken just now when I posted the screenshot and the instance is still up.
2 months ago

Tim Holloway wrote:I'm afraid I don't have much use for videos myself. I prefer text that I can jump around in and hold onto.

But regardless, when you say you have opened the firewall on "your machine", do you mean your machine or the Amazon EC2 machine? Because your machine probably has the ability to make outbound requests by default, but unless you open up the Amazon firewall, that won't help.

Beyond that, a quick check of IP indicates that no ports are open, including the SSH access, so that machine is evidently down at the moment.

Bear in mind that Amazon dynamically assigns IP addresses and routes through internal networking, and that you may no longer be talking to the proper host.

Yes, I referred my system's browser from where I'm trying to access Do I need to ensure the firewall is put off in the EC2 instance too? Just reconfirming is up and running and default port 8080 is open. Attaching a referencing screenshot. Please let me know if my understanding is not correct.
2 months ago
Adding here the log after starting up the Spring boot application inside EC2 instance.

[root@ip-172-31-22-84 ~]# java -jar spring-boot-aws.jar

 .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/  ___)| |_)| | | | | || (_| |  ) ) ) )
 '  |____| .__|_| |_|_| |_\__, | / / / /
:: Spring Boot ::                (v2.5.5)

2021-10-30 14:47:59.881  INFO 6251 --- [           main] j.e.api.SpringBootToDeployApplication    : Starting SpringBootToDeployApplication v0.0.1-SNAPSHOT using Java 1.8.0_302 on with PID 6251 (/root/spring-boot-aws.jar started by root in /root)
2021-10-30 14:47:59.893  INFO 6251 --- [           main] j.e.api.SpringBootToDeployApplication    : No active profile set, falling back to default profiles: default
2021-10-30 14:48:02.598  INFO 6251 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2021-10-30 14:48:02.634  INFO 6251 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-10-30 14:48:02.635  INFO 6251 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.53]
2021-10-30 14:48:02.778  INFO 6251 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-10-30 14:48:02.779  INFO 6251 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2718 ms
2021-10-30 14:48:04.201  INFO 6251 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-10-30 14:48:04.219  INFO 6251 --- [           main] j.e.api.SpringBootToDeployApplication    : Started SpringBootToDeployApplication in 5.444 seconds (JVM running for 6.442)
2 months ago

Tim Holloway wrote:OK. Bear with me. I tend to get S3 (object storage) and EC2 (Elastic Cloud Computing) confused. Acronyms can be more trouble than they're worth sometimes.

EC2 provides VM instances. Now actually, for this app, I'd look at Elastic Beanstalk rather than an entire personal VM, but it's a matter of preference.

To run a Spring Boot app in EC2, you need to do the following:

1.  Create an EC2 instance and launch it.
2. Upload your Spring Boot Jar and launch it.
3. Ensure that the Amazon Firewall to that EC2 instance has the proper ports open. In other words, if you're blocking port 8080 (which Amazon will do by default), then external clients won't be able to talk to the app.

Here I'd like to note that 8080 is not the default port for HTTP. That's port 80, so you have to include an explicit override in your URLs. And since port 80 is a protected port, the only ways that you can make a Spring Boot app visible on port 80 are to A) override its default setting and run as a privileged user (NOT recommended) or B) proxy from a server that can service port 80 to the Spring Boot app using a proxy server such as Apache or Nginx. This is actually the better approach when hosting multiple Spring Boot apps on the same server instance.

I follow this YouTube video for initial learning ( and ensured follow all the steps described in the videos.

While ensuring the 1,2,3 steps mentioned by you above, created an EC2 and launched it. SB app is uploaded and executed on EC2 instance and confirmed the APP is up. Step 3, I ensured the firewall is off in my system. I'm running the app on 8080 port inside the EC2 instance, so do you think is it now not available for other clients is unable to talk?If so, how does that relate to the message what I'm getting here( took too long to respond)., This is just clarification. But the YTuber uses the same port, I don't hesitate to use another port but the app has been launched on the 8080 port, so I think, I've difficulty in understanding the point 3. Do you think so? Do I've to use a different port to make sure this is port problem?  Any comments from you may help. Thanks.
2 months ago

Tim Holloway wrote:I haven't the faintest idea of what any of that is supposed to mean.

The first URL times out because it's addressing a specific AWS instance that you created which isn't running any more. The other URLs appear to simply access the JAR as an object stored in EC2, but I have no clue as to what that's supposed to be doing for you.

Simply, A normal hello world spring boot application is running on EC2 instance and it's running(sure). I kick-started with the java *.jar command( java -jar spring-boot-aws.jar.). Logged in as EC2 user using SSH into EC2 instance to deploy and start the application. Application is deployed to EC2 instance and running. But when I try to access the application using public DNS getting the attached message.

I simply access the application through the ec2 instance public DNS. In return I'm expecting "Let's learn together". The code snippet is below.

2 months ago

Tim Holloway wrote:Why are you storing an executable application in S3 storage? Aren't you deploying it to the Amazon cloud?

Yeah deployed to EC2 instance using wget as below. when trying to access through the public DNS getting the site can't be reached and ERR_CONNECTION_TIMED_OUT.


--2021-10-30 09:34:38--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
2 months ago