Ryan,

Word-wrapping didn't help on this one...

On 6/10/24 15:44, Ryan Esch wrote:
Hi folks,I have a webapp running Apache Tomcat 9.0.67 with Java 11, using 
JASPIC for authentication. For reference, using these:
             <groupId>org.apache.tomcat</groupId>            
<artifactId>tomcat-catalina</artifactId>            <version>9.0.85</version>
             <groupId>org.apache.tomcat</groupId>            
<artifactId>catalina</artifactId>            <version>6.0.53</version>

Are you using two different versions of Tomcat glued together? tomcat-catalina is 9.0.85 (and not 9.0.67 as you claim above) but also catalina is 6.0.53?

You might want to sort this out before moving forward any more.

This works.I need to get this running with Java 17. I've updated my javax 
classes to jakarta and my JASPIC dependencies to:
             <groupId>org.apache.tomcat</groupId>            
<artifactId>tomcat-jaspic-api</artifactId>            <version>11.0.0-M5</version>
             <groupId>org.apache.tomcat</groupId>            
<artifactId>tomcat-catalina</artifactId>            <version>11.0.0-M5</version>

Those are Tomcat dependencies. Don't you have any dependencies on like servlet-api and jaspic and things like that? Those are much more important than depending on Tomcat itself.

Unless you are actually launching Tomcat from Maven or using Tomcat as an embedded server inside your application, you shouldn't have any Maven dependencies on Tomcat *at all*. You should be using the servlet-api and related artifacts instead.

Also... you have chosen Tomcat 11 dependencies, but you are deploying onto Tomcat 9.0.something. Not going to work.

These are built with Java 17. My webapp compiles and builds. But at runtime, I 
get errors like this:
java.lang.VerifyError: Bad type on operand stackException Details:  Reason:    
Type 'org/apache/catalina/authenticator/jaspic/AuthConfigFactoryImpl' (current 
frame, stack[4]) is not assignable to 
'jakarta/security/auth/message/config/AuthConfigFactory'
Specifically, this does not cause any issues:          AuthConfigFactory 
factory = new AuthConfigFactoryImpl();
However, if I call any method on this factory, I see the above Error.I can't 
seem to figure out the cause. I don't see any old javax AuthConfig classes in 
the dependencies.Anyone familiar with this?

This is definitely a javax/jakarta impedance issue.

I would go back to your pom and see if you are able to remove Tomcat completely. You should really be using these dependencies instead:

    <dependency>
      <groupId>jakarta.platform</groupId>
      <artifactId>jakarta.jakartaee-api</artifactId>
      <version>8.0.0</version>
      <scope>provided</scope>
    </dependency>

This is for the servlet API itself. JASPIC (now "Jakarta Authentication") is of course a separate artifact.

Once your application is building to a WAR properly, try deploying it into Tomcat 10 or Tomcat 11. As Chuck says, Tomcat 10 is the first version of Tomcat that supports the Jakarta APIs.

Going *way back to the beginning*, getting your application working with Java 17 should have been trivial: just install Java 17 and run everything you already had without any changes whatsoever. You shouldn't have even needed to recompile anything.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to