Why does spring-boot-3 give javax.servlet.http.HttpServletRequest ClassNotFoundException - java

When I ran spring-boot-2.7, there is no issue. However when I changed code and tailored it to spring-boot-3.0, there is java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
Could someone help me to download the source code and run on your computer? After run it, and you click "Login using Facebook", you will see the exception.
https://github.com/chuangtc/spring-boot-3.0-security-social-login
I tried adding jarkarta servlet api 6.0, but the exception is still there.

You don't have to add jakarta servlet api 6.0 into the pom.xml.
According to documentation here, it is already included.
In your code whichever is using javax.servlet.http.HttpServletRequest, you need to change the javax to jakarta.
So the whole line will be something like this:
import jakarta.servlet.http.HttpServletRequest
I faced this error before when I upgrade my service as well and I solved it using this way. Maybe you can try it.
[EDIT]
I see that one of your dependency is using the javax.servlet:
https://mvnrepository.com/artifact/org.springframework.social/spring-social-facebook/2.0.3.RELEASE
And following this github, it seems this packages is no longer actively maintained and being archived, so it is likely they do not upgrade for Spring Boot 3.
I would recommend find other ways to work on the social login for Facebook, maybe you can try this way?
https://www.codejava.net/frameworks/spring-boot/social-login-with-facebook-example

Related

Cannot access javax.servlet.Filter class file for javax.servlet.Filter not found

I'm working in a project and right now I'm migrating the project to Spring 3.0. So I made some changes in some classes. I can not share the classes because of the job rules but this class about the AwsXrayConfig class. And using filter. But when I try to build project I'm getting this "cannot access javax.servlet.Filter" error. In the class I already updated javax to jakarta but AWSXRayServletFilter still using com.amazon.xray.javax.servlet.AWSXRayServletFilter library. So I'm stuck here. Also I'm not sure about looking the true place? Is that about jakarta or spring or aws libraries I''m not sure. Any ideas? Thx
I already removed import part about AWSXRayServletFilter but it's complaining. I changed javax.servlet.Filter to jakarta.servlet.Filter. Thats it
Thanks for bringing this to our attention.
There is an issue with the latest version of Spring since it is using Jakarta instead of javax.
I will add this as a work item for us.

How to use Primefaces in OSGi-Framework karaf?

I want to use Primefaces in karaf. For that i combined the karaf-war-example with pax-web-primefaces-example and get a working karaf-feature which can be found at bitbucket.
The example works fine, but when i want to extend the project with any other primeface-example, like clock, ThemeSwitcher or a Panel, it not works correct.
So far i found out that i need to add javax.annotations as dependency. This compile correct, but shows not the expected results in browser. Maybe the missing views are broken because the javax.annotations is not added to the lib-folder in war. But i added it manually to the war and get no progress.
Rendering is
but should look like
I am not so skilled in osgi and felix that i not understood what is needed. Also i have the problem that no exception occurs, so i have no hint where i should look at.

Configuring Swagger with Play/Java-framework-2.5

I am trying to configure Swagger with my Play-2.5 project.
I followed this tutorial and it worked, but only for the older version of Play and not working with Play-2.5. As the project has migrated into Play-2.5, we had to remove the swagger configuration.
Firstly, the issue seemed to be with static controller vs non static controller in Play-2.5, but I ended up with proving myself wrong.
I am facing this error
type ApiHelpController is not a member of package controllers
GET /api-docs controllers.ApiHelpController.getResources
If any one knows any link for Swagger configuration with Play-2.5 for Java, please guide.
PS: there are tutorials available for Scala not for java.
Try this repo:
https://github.com/CreditCardsCom/swagger-play
I created this as a temporary workaround until we get support for Play 2.5 in the official swagger-play repo.
I have only used the Play-Swagger project from Zalando. There is a lot of documentation and the repo is kept up-to-date.
If you want a quick start you can take a look at their Activator Template - just run it and you will get the Swagger generated documentation (Swagger UI is already included). From there you can start tweaking it (look for the conf/echo.yaml file).
The problem is, the com.wordnik swagger-play2(What your tutorial is using as a library) breaks with Play 2.4 and up.
You can try this which uses a different one (io.swagger). I have used this and it works well with 2.4. But it also breaks with 2.5.

java.lang.NoClassDefFoundError in android

I am new to Android development. I'm working on an project which involves using stubs for web services. When I try to use it, I get the following error:
I've been stuck here for a week, so some help would be highly appreciated.
It seems that there is some packaging or deployment issues with the included libraries that you use in you project. This error is thrown when the Java Virtual Machine or a ClassLoader instace try to load the definition of the a class but cannot find it anywhere. In most cases, this occurs when something is messed up in your project configurations but i cannot tell what from the information provided. A solution would be to configure your project from the scratch since most of the times this is easier than finding what causes the problem. Also in case you had an older version of ADT (<17) the answer of this SO question might be usefull. Finally, if you are importing any javax libararies(or libraries that have javax components in them), this maybe the source of your problem since Adroid does not support the javax library.

Is it possible to use asm-x.x.jar in Google App Engine when using Spring Framework?

If I include asm-x.x.jar in my Web application, I get errors. Errors can be removed by removing asm-x.x.jar from the classpath. But I need to use Aspects in my app, so I have to have asm-x.x.jar in my classpath. Are there any work arounds for this problem?
http://code.google.com/p/googleappengine/issues/detail?id=2527
Check this, apparently this should work if done correctly.
http://www.ardentlord.com/apps/blog/show/829881-spring-3-0-on-google-app-engine

Categories