wslite SOAPClient.send() - soap

I am using wslite(groovy-wslite-0.8.0.jar) from groovy to call a soap service.
Request: (String) SOAP XML-Request
def client = new SOAPClient(URL)
response = client.send(requestSOAPBody)
The above code was working till today morning and now causing exception without any code changes.
I am getting an exception like:
[Fatal Error] :1:10: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
wslite.soap.SOAPClientException: 500 Internal Server Error
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:202)
at wslite.soap.SOAPClient.generateSOAPFaultException(SOAPClient.groovy:118)
at wslite.soap.SOAPClient.this$2$generateSOAPFaultException(SOAPClient.groovy)
at wslite.soap.SOAPClient$this$2$generateSOAPFaultException$10.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at wslite.soap.SOAPClient.send(SOAPClient.groovy:59)
What could be the possible solution for this

Have you tried client.allowDocTypeDeclaration = false before calling send()? It looks like SOAPClient passes this property to XmlSlurper on instanciating it, and it is set to true by default (see SOAPClient.groovy).

Related

How can I update a existing Keycloak client attribute in a realm?

I've added few attributes for each client in keycloak, and now I need to update the existing client attribute to new value without deleting the client.
List<ClientRepresentation> list = realm.clients().findByClientId(client.getClientId());
ClientResource resource = realm.clients().get(client.getClientId());
ClientRepresentation clientRepresentation = list.get(0);
//clientRepresentation.getAttributes().put(KeyCloakAttribute.OBJECT_BASED_ACCESS.getLabel(), application.getAttributes().getObjectBasedModel());
clientRepresentation.setName("updated-name");
resource.update(clientRepresentation); <- This line is throwing error
I could see client resource is providing update method, but when i use it i'm getting 404 error.
2022-01-22 19:07:29.057 -ERROR 15870 [SpringApplication.java] [reportFailure] [org.springframework.boot.SpringApplication]:826 --- [restartedMain] ngp-dev-env o.s.boot.SpringApplication : Application run failed javax.ws.rs.NotFoundException: HTTP 404 Not Found
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:225)
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:195)
at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:62)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invokeSync(ClientInvoker.java:151)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:112)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:76)
at com.sun.proxy.$Proxy229.getServiceAccountUser(Unknown Source)
at com.service.KeycloakApplication.updateAttributes(KeycloakApplication.java:89)
at com.service.RegisterService.register(RegisterService.java:32)
at com.OpenAPI2SpringBoot.registerApplication(OpenAPI2SpringBoot.java:88)
at com.OpenAPI2SpringBoot.onApplicationEvent(OpenAPI2SpringBoot.java:80)
at com.OpenAPI2SpringBoot.onApplicationEvent(OpenAPI2SpringBoot.java:1)
at com.OpenAPI2SpringBoot$$EnhancerBySpringCGLIB$$a66f061b.onApplicationEvent(<generated>)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:103)
at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330)
at com.OpenAPI2SpringBoot.main(OpenAPI2SpringBoot.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
keycloak client resource update docs
am I doing it in the wrong way or is there any other way to do it ?
According to the API documentation realm.clients() returns a ClientsResource interface. The method findByClientId requests the clientId as parameter but the method get:
#Path(value="{id}")
ClientResource get(#PathParam(value="id")
String id)
requests the id of the client, not the client ID.
So you need to replace:
realm.clients().get(client.getClientId());
with
realm.clients().get(client.getId());

OConcurrentcreateException when creating a record at commit because of wrong RID

OrientDB Version: 3.0.5
Java Version: 1.8
OS: Debian
Hello,
I'm getting a systematic error linked to RID when executing this simple code :
orientdb = new OrientDB(dbUrl, dbUser,dbPassword, OrientDBConfig.defaultConfig());
session = orientdb.open(databaseName, dbUser, dbPassword);
session.begin();
OVertex v = session.newVertex("Folder");
v.setProperty("name", "RootFolder");
session.save(v);
session.commit();
I'm executing the a code on one of the machine on a cluster of 3 but there is no other code or user interacting with the cluster.
I also read about optimistic transaction but, here, the Exception is thrown 100% of the time.
I believe the Exception is triggered at
session.commit()
Here is the error :
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: com.orientechnologies.orient.core.exception.OConcurrentCreateException: Cannot create the record #17:4 because the assigned RID was #17:3 instead
DB name="FDStest"
DB name="FDStest"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:318)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:275)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:191)
at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:153)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1779)
at com.orientechnologies.orient.client.remote.OStorageRemote.lambda$networkOperationRetryTimeout$2(OStorageRemote.java:226)
at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:285)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationRetryTimeout(OStorageRemote.java:214)
at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperationNoRetry(OStorageRemote.java:239)
at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:964)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.internalCommit(ODatabaseDocumentAbstract.java:2733)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:534)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:100)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.commit(ODatabaseDocumentAbstract.java:2221)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.commit(ODatabaseDocumentAbstract.java:2191)
at OrientDb.OrientST.OrientDBDataBaseGenerationToolCluster.<init>(OrientDBDataBaseGenerationToolCluster.java:60)
at OrientDb.OrientST.App.main(App.java:21)
... 5 more
The relevant part being :
Cannot create the record #17:4 because the assigned RID was #17:3 instead
Any help is welcome. Thanks.
Also, when I try this code :
OVertex v = session.newVertex("Folder");
session.save(v);
the operation has 10% chance to succeed.
Turns out performing an action TRUNCATE like :
TRUNCATE CLASS V UNSAFE
Will mess up the RID from the database in a permanent way.

minecraft forge modding mods folder

I tried to test a Minecraft Mod im developing right now and this error popped up in the console:
[15:31:05] [main/INFO] [FML]: Searching E:\MinecraftForgeMods\forge-1.12.2-14.23.4.2705-mdk\run\.\mods for mods
[15:31:05] [main/ERROR] [FML]: Unable to construct net.minecraftforge.fml.common.Mod container
In theory there shouldn't be a folder between 'run' and 'mods'. I tried creating such a folder, but that doesn't work of course, and searched for while but found nothing to this problem.
So does anyone have an idea how to get the right searching path?
As per https://unix.stackexchange.com/questions/249039/what-means-the-dots-on-a-path
E:\MinecraftForgeMods\forge-1.12.2-14.23.4.2705-mdk\run\.\mods
will resolve to E:\MinecraftForgeMods\forge-1.12.2-14.23.4.2705-mdk\run\mods
. represents the current directory, when it's mid-way through a path, it doesn't do anything.
The reason it's getting displayed, is the path that is being output isn't the resolved/absolute path, but the relative/dynamic path that has been built from multiple pieces.
this error popped up
The first line isn't an Error! It's an INFO, there is no reason to worry, this is normal.
Unable to construct net.minecraftforge.fml.common.Mod container
This is a problem, but unless there were lines before this it's hard if not impossible to tell what's going wrong.
If you have other mods in your mods directory, try removing them.
If this has only started happening after you started making your mod, Then it's likely something in your mod.
Usually there is a stack trace immediately after that, this one shows an issue in
*Caused by: java.lang.IllegalArgumentException: The modid CraftingTableIV is not the same as it's lowercase version. Lowercasing will be enforced in 1.11
at
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_111]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_111]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111]
at net.minecraftforge.fml.common.ModContainerFactory.build(ModContainerFactory.java:86) [ModContainerFactory.class:?]
at net.minecraftforge.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:87) [JarDiscoverer.class:?]
at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:49) [ContainerType.class:?]
at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:78) [ModCandidate.class:?]
at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:141) [ModDiscoverer.class:?]
at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:382) [Loader.class:?]
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:522) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:225) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:438) [beq.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:350) [beq.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_111]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
*Caused by: java.lang.IllegalArgumentException: The modid CraftingTableIV is not the same as it's lowercase version. Lowercasing will be enforced in 1.11
at net.minecraftforge.fml.common.FMLModContainer.sanityCheckModId(FMLModContainer.java:144) ~[FMLModContainer.class:?]
at net.minecraftforge.fml.common.FMLModContainer.<init>(FMLModContainer.java:126) ~[FMLModContainer.class:?]
... 21 more

Error on GitHub Talend Job with tRESTClient

I'm getting error while executing talend job,
This is my another job,
tRESTClient --> tXMLMap --> tLogrow
The Error is:
Exception in component tRESTClient_1 (GitHubJob)
javax.ws.rs.NotSupportedException: HTTP 415 Unsupported Media Type
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:507)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:895)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:863)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:426)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:609)
at local_project.githubjob_0_1.GitHubJob.tRESTClient_1Process(GitHubJob.java:1185)
at local_project.githubjob_0_1.GitHubJob.tMongoDBConnection_1Process(GitHubJob.java:440)
at local_project.githubjob_0_1.GitHubJob.runJobInTOS(GitHubJob.java:1982)
[statistics] disconnected
at local_project.githubjob_0_1.GitHubJob.main(GitHubJob.java:1831)
What is the solution for this issue?
Please add HTTP header like : content-type = "application/json"

roo sample gwtNoEntities fails to load

I've just tried the the gwtNoEntities sample that is bundled with roo-1.1.0.
when launching using tomcat:run, or jetty:run, I get only the loading box.
When running it in GWT hosted mode, I get the following stacktrace reported in the client,
this appears to be an error related to setting up the default place using browser history, which is empty.
What would be the correct way to go about fixing this?
stacktrace
00:02:08.323 [ERROR] Unable to load module entry point class com.springsource.foo.client.scaffold.Scaffold (see associated exception for details)
java.util.NoSuchElementException: null
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at com.springsource.foo.client.scaffold.ScaffoldDesktopApp.init(ScaffoldDesktopApp.java:139)
at com.springsource.foo.client.scaffold.ScaffoldDesktopApp.run(ScaffoldDesktopApp.java:61)
at com.springsource.foo.client.scaffold.Scaffold.onModuleLoad(Scaffold.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)
generated code in question
/* Browser history integration */
ScaffoldPlaceHistoryMapper mapper = GWT.create(ScaffoldPlaceHistoryMapper.class);
mapper.setFactory(placeHistoryFactory);
PlaceHistoryHandler placeHistoryHandler = new PlaceHistoryHandler(mapper);
/* 139 */ ProxyListPlace defaultPlace = getTopPlaces().iterator().next();
placeHistoryHandler.register(placeController, eventBus, defaultPlace);
placeHistoryHandler.handleCurrentHistory();
You may replace the generated code with while condition block at the below (line 139)
while (getTopPlaces().iterator().hasNext()) {
ProxyListPlace defaultPlace = getTopPlaces().iterator().next();
placeHistoryHandler.register(placeController, eventBus, defaultPlace);
placeHistoryHandler.handleCurrentHistory();
}
recompile with mvn compile, restart with mvn gwt:run. Now you should have no error but with empty page.
The gwtNoEntities.roo example has no data. You may try other example like expenses.roo. The generated code should be okay.
Please remember to accept the answer if it helps.
Thanks.