[keycloak-user] Export

LIEVRE Olivier olivier.lievre at altran.com
Thu Feb 16 04:35:15 EST 2017


Hello,

I had the same issue with version 2.5.1.final, and resolved it by adding 
            <spi name="userFederatedStorage">
                <default-provider>jpa</default-provider>
            </spi>

In subsystem keycloak-server of configuration file (standalone.xml).

In keycloak overlay delivery, this info is missing in default-keycloak-subsys-config.cli.

KR,
Olivier

-----Message d'origine-----
De : keycloak-user-bounces at lists.jboss.org [mailto:keycloak-user-bounces at lists.jboss.org] De la part de Bruno Oliveira
Envoyé : mardi 13 décembre 2016 15:42
À : Brian Schwartz
Cc : keycloak-user
Objet : Re: [keycloak-user] Export

That's odd, I could not reproduce your issue. What I did was:

- Export:

bin/standalone.sh -Dkeycloak.migration.action=export -Dkeycloak.migration.provider=singleFile
-Dkeycloak.migration.file=myrealm.json

- Import:

bin/standalone.sh -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile
-Dkeycloak.migration.file=myrealm.json

I'm attaching my json file to make sure we're talking about the same thing.


On 2016-12-08, Brian Schwartz wrote:
> The command I ran to get the error is below.  Before that, I 
> downloaded a fresh copy of keycloak 2.4.0.final standalone, started it 
> up, and entered my configuration.  I have one realm other than the 
> master.  It used identity brokering oidc 1.0.  I have one simple public oidc client.
>
> On Dec 8, 2016 5:35 AM, "Bruno Oliveira" <bruno at abstractj.org> wrote:
>
> > Hi Brian, do you have the steps to reproduce the issue? I never had 
> > such problem.
> >
> > On 2016-12-07, Brian Schwartz wrote:
> > > Is the keycloak export functionality broken since the last couple 
> > > of versions?
> > >
> > >
> > >
> > > https://urldefense.proofpoint.com/v2/url?u=https-3A__keycloak.gitb
> > > ooks.io_server-2Dadminstration-2Dguide_&d=DgIDaQ&c=cxWN2QSDopt5Skl
> > > NfbjIjg&r=_-9p_K0wFARfQIX1BCw4oNBvhM4d9Cd5Fas_DHDJE8o&m=LEVaH5ey2D
> > > 2aY5mp5uKGge7-lwJRhHPukmZlrUmy2AY&s=Z1rzCu91HYojtEXXilUV-Kjjg-HqHc
> > > zjpyntyUOke50&e= content/v/2.4/topics/export-import.html
> > >
> > >
> > >
> > > I run this command:
> > >
> > > ./standalone.sh -Dkeycloak.migration.action=export
> > > -Dkeycloak.migration.provider=singleFile 
> > > -Dkeycloak.migration.file= demokeycloak.json
> > >
> > >
> > >
> > > I get this error:
> > >
> > >
> > >
> > > 14:00:33,664 INFO
> > > [org.keycloak.exportimport.singlefile.SingleFileExportProvider]
> > > (ServerService Thread Pool -- 48) Exporting model into file 
> > > /Users/xxxx/Downloads/keycloak-2.4.0.Final/bin/demokeycloak.json
> > >
> > > 14:00:34,163 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: 
> > > Server shutdown has been requested.
> > >
> > > 14:00:34,222 INFO  [org.jboss.as.connector.subsystems.datasources] 
> > > (MSC service thread 1-4) WFLYJCA0010: Unbound data source 
> > > [java:jboss/datasources/KeycloakDS]
> > >
> > > 14:00:34,267 ERROR [org.jboss.msc.service.fail] (ServerService 
> > > Thread
> > Pool
> > > -- 48) MSC000001: Failed to start service jboss.undertow.deployment.
> > > default-server.default-host./auth: 
> > > org.jboss.msc.service.StartException
> > in
> > > service jboss.undertow.deployment.default-server.default-host./auth:
> > > java.lang.RuntimeException: RESTEASY003325: Failed to construct 
> > > public org.keycloak.services.resources.KeycloakApplication(
> > > javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
> > >
> > >                 at org.wildfly.extension.undertow.deployment.
> > > UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
> > >
> > >                 at java.util.concurrent.Executors$RunnableAdapter.
> > > call(Executors.java:511)
> > >
> > >                 at java.util.concurrent.FutureTask.run(FutureTask.
> > java:266)
> > >
> > >                 at 
> > > java.util.concurrent.ThreadPoolExecutor.runWorker(
> > > ThreadPoolExecutor.java:1142)
> > >
> > >                 at 
> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > ThreadPoolExecutor.java:617)
> > >
> > >                 at java.lang.Thread.run(Thread.java:745)
> > >
> > >                 at org.jboss.threads.JBossThread.
> > run(JBossThread.java:320)
> > >
> > > Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to
> > construct
> > > public org.keycloak.services.resources.KeycloakApplication(
> > > javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
> > >
> > >                 at org.jboss.resteasy.core.ConstructorInjectorImpl.
> > > construct(ConstructorInjectorImpl.java:162)
> > >
> > >                 at org.jboss.resteasy.spi.ResteasyProviderFactory.
> > > createProviderInstance(ResteasyProviderFactory.java:2209)
> > >
> > >                 at org.jboss.resteasy.spi.ResteasyDeployment.
> > > createApplication(ResteasyDeployment.java:299)
> > >
> > >                 at 
> > > org.jboss.resteasy.spi.ResteasyDeployment.start(
> > > ResteasyDeployment.java:240)
> > >
> > >                 at org.jboss.resteasy.plugins.server.servlet.
> > > ServletContainerDispatcher.init(ServletContainerDispatcher.java:11
> > > 3)
> > >
> > >                 at org.jboss.resteasy.plugins.server.servlet.
> > > HttpServletDispatcher.init(HttpServletDispatcher.java:36)
> > >
> > >                 at io.undertow.servlet.core.
> > LifecyleInterceptorInvocation.
> > > proceed(LifecyleInterceptorInvocation.java:117)
> > >
> > >                 at org.wildfly.extension.undertow.security.
> > > RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
> > >
> > >                 at io.undertow.servlet.core.
> > LifecyleInterceptorInvocation.
> > > proceed(LifecyleInterceptorInvocation.java:103)
> > >
> > >                 at io.undertow.servlet.core.ManagedServlet$
> > > DefaultInstanceStrategy.start(ManagedServlet.java:231)
> > >
> > >                 at io.undertow.servlet.core.
> > ManagedServlet.createServlet(
> > > ManagedServlet.java:132)
> > >
> > >                 at 
> > > io.undertow.servlet.core.DeploymentManagerImpl.start(
> > > DeploymentManagerImpl.java:526)
> > >
> > >                 at org.wildfly.extension.undertow.deployment.
> > > UndertowDeploymentService.startContext(UndertowDeploymentService.
> > java:101)
> > >
> > >                 at org.wildfly.extension.undertow.deployment.
> > > UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
> > >
> > >                 ... 6 more
> > >
> > > Caused by: java.lang.NullPointerException
> > >
> > >                 at org.keycloak.models.utils.ModelToRepresentation$2.
> > > compare(ModelToRepresentation.java:431)
> > >
> > >                 at org.keycloak.models.utils.ModelToRepresentation$2.
> > > compare(ModelToRepresentation.java:428)
> > >
> > >                 at java.util.TimSort.countRunAndMakeAscending(
> > > TimSort.java:356)
> > >
> > >                 at java.util.TimSort.sort(TimSort.java:220)
> > >
> > >                 at java.util.Arrays.sort(Arrays.java:1512)
> > >
> > >                 at java.util.ArrayList.sort(ArrayList.java:1454)
> > >
> > >                 at 
> > > java.util.Collections.sort(Collections.java:175)
> > >
> > >                 at org.keycloak.models.utils.ModelToRepresentation.
> > > exportAuthenticationFlows(ModelToRepresentation.java:428)
> > >
> > >                 at org.keycloak.models.utils.ModelToRepresentation.
> > > toRepresentation(ModelToRepresentation.java:372)
> > >
> > >                 at org.keycloak.exportimport.
> > util.ExportUtils.exportRealm(
> > > ExportUtils.java:87)
> > >
> > >                 at org.keycloak.exportimport.singlefile.
> > > SingleFileExportProvider$1.runExportImportTask(
> > > SingleFileExportProvider.java:65)
> > >
> > >                 at org.keycloak.exportimport.
> > util.ExportImportSessionTask.
> > > run(ExportImportSessionTask.java:35)
> > >
> > >                 at org.keycloak.models.utils.KeycloakModelUtils.
> > > runJobInTransaction(KeycloakModelUtils.java:236)
> > >
> > >                 at org.keycloak.exportimport.singlefile.
> > > SingleFileExportProvider.exportModel(SingleFileExportProvider.java
> > > :58)
> > >
> > >                 at org.keycloak.exportimport.
> > ExportImportManager.runExport(
> > > ExportImportManager.java:102)
> > >
> > >                 at org.keycloak.services.resources.KeycloakApplication.
> > > <init>(KeycloakApplication.java:149)
> > >
> > >                 at
> > > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > Method)
> > >
> > >                 at sun.reflect.NativeConstructorAccessorImpl.
> > newInstance(
> > > NativeConstructorAccessorImpl.java:62)
> > >
> > >                 at sun.reflect.DelegatingConstructorAccessorI
> > > mpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> > >
> > >                 at java.lang.reflect.Constructor.
> > > newInstance(Constructor.java:423)
> > >
> > >                 at org.jboss.resteasy.core.ConstructorInjectorImpl.
> > > construct(ConstructorInjectorImpl.java:150)
> > >
> > >                 ... 19 more
> > >
> > >
> > >
> > >
> > >
> > > This has not worked for me since version 2.1.0.
> > >
> > > I’m currently using version 2.4.0.Final.
> > >
> > >
> > >
> > > Thanks
> > > _______________________________________________
> > > keycloak-user mailing list
> > > keycloak-user at lists.jboss.org
> > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.o
> > > rg_mailman_listinfo_keycloak-2Duser&d=DgIDaQ&c=cxWN2QSDopt5SklNfbj
> > > Ijg&r=_-9p_K0wFARfQIX1BCw4oNBvhM4d9Cd5Fas_DHDJE8o&m=LEVaH5ey2D2aY5
> > > mp5uKGge7-lwJRhHPukmZlrUmy2AY&s=aI6ONDWTYxkaXH2hJWrN0gcOE9upqOF-H8
> > > clTdqG-fc&e=
> >
> > --
> >
> > abstractj
> > PGP: 0x84DC9914
> >

--

abstractj
PGP: 0x84DC9914



More information about the keycloak-user mailing list