Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

java - Keycloak custom provider - error after redeploying artifact

in my project I am using custom storage SPI which makes some calls to external service to get user metadata. The client of that service(UserAdmin) is basically an interface with jax-ws annotations processed by RestEasy:

@Path("/{realm}/keycloak")
public interface UserAdminServiceClient {

    @Path("/users")
    UsersResource users(@PathParam("tenant") String tenant);
}

There is also an external library with model classes(annotated with javax.xml.bind) which client uses. Everything is packaged in .ear file with jboss-deployment-structure like this:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3">
    <sub-deployment name="useradmin-service-federation-provider.jar">
        <dependencies>
            <module name="org.jboss.logging"/>

            <module name="org.keycloak.keycloak-core"/>
            <module name="org.keycloak.keycloak-common"/>
            <module name="org.keycloak.keycloak-services"/>
            <module name="org.keycloak.keycloak-server-spi"/>
            <module name="org.keycloak.keycloak-server-spi-private"/>
            <module name="org.keycloak.keycloak-saml-core" />
            <module name="org.keycloak.keycloak-saml-core-public"/>

            <module name="javax.api"/>
            <module name="org.dom4j"/>
            <module name="org.apache.xerces"/>
            <module name="javax.ws.rs.api"/>
            <module name="org.jboss.resteasy.resteasy-jaxrs"/>

            <module name="com.sun.xml.bind"/>
            <module name="javax.xml.bind.api"/>
            <module name="org.jboss.resteasy.resteasy-jaxb-provider"/>

            <module name="com.fasterxml.jackson.core.jackson-core" export="true"/>
            <module name="com.fasterxml.jackson.core.jackson-databind" export="true"/>
            <module name="org.apache.commons.lang3"/>
        </dependencies>
    </sub-deployment>
</jboss-deployment-structure>

The problem I have is when I redeploy the .ear file in standalone/deployments by overwriting the old one there is no error, but when I try to fetch the token(for whhich it actually needs to use storage SPI) I get the following:

javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/xml and type class com.userservice.model.User

After I restart the keycloak, it starts working fine as if nothing happened. Where did I mess up? Modules are declared and loaded but for some reason resteasy couldn't use jaxb-provider.

question from:https://stackoverflow.com/questions/65924721/keycloak-custom-provider-error-after-redeploying-artifact

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...