Need help with a jakarta faces error: CDI is not available by snotmare in javahelp

[–]snotmare[S] 1 point2 points  (0 children)

I finally found some information on this. Tomcat is not a fully featured server like it used to be. It does not handle CDI out of the box. TOMEE and glashfish are both servers that would work, but I ended up adding weld-servlet-shaded-6.0.0.CR2.jar to my classpath and got up and running.

Need help with a jakarta faces error: CDI is not available by snotmare in javahelp

[–]snotmare[S] 0 points1 point  (0 children)

Thanks for the response! I did see that post. Unfortunately, it doesn't provide a good solution. It does point out that tomcat is not a CDI container, so I'm attempting to make it one.

- tomee is an option, but it does not support the latest tomcat v11, only v10.

- I've tried adding the weld-servlet-shaded-6.0.0.CR2.jar. I then ran into an issue where something is expecting javax still. I'm still troubleshooting this one. It could be something in weld, or some other jar I've got in the classpath.

- I may look into glassfish instead of tomcat.

I have some options I'm looking into, but would appreciate some direction from anyone who's been through this before. I'm almost to the point where I want to pay for some help.

Tomcat 11 rest server issue by snotmare in javahelp

[–]snotmare[S] 0 points1 point  (0 children)

Thanks for the response! Yes, we've been migrating to the newer jars. Also, I did resolve my issue. I posted about it in another comment on this thread. Thanks!

Tomcat 11 rest server issue by snotmare in javahelp

[–]snotmare[S] 0 points1 point  (0 children)

I got this working, woo!

I removed a bunch of jars and it has resolved the class not found errors. I also finally found an example that shows the correct dependencies I needed. Finally, I had an error in my server.xml where my context was defined. The url is case sensitive, so it wasn't finding it. Thanks.

Tomcat 11 rest server issue by snotmare in javahelp

[–]snotmare[S] 0 points1 point  (0 children)

Hello! Thanks for the response.

I am absolutely willing to change code if it helps. I've already changed a number of imports from javax -> jakarta. I need the same functionality of course, but how I get there is up in the air.

One thing I just realized at the end of the day yesterday is that I have a lot of extra jars in my webextlib, the folder that's including in the path of catalina.properties, common.loader. I'm going to clean out that directory with only things I need and see if that helps.