Hyperic HQ Api getting an agent - java

I'm a newbie with Hyperic but I'm so happy about discovering this tool it's very powerful and I think it can be adapted perfectly to my necessities. I have a problem using the API. I'm trying to use it through java directly and I'm trying to get my agent because I need it in further operations.
If I use the directly from command line it works perfectly.
./hqapi.sh agent list --host localhost --port 7080 --user hqadmin --password hqadmin --secure false
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AgentsResponse>
<Status>Success</Status>
<Agent id="10001" address="127.0.1.1" port="2144" version="4.4.0" unidirectional="false"/>
</AgentsResponse>
But when I try to get this agent in Java I get an error that I don't know how to solve.
AgentsResponse agentsResponse = agentApi.getAgents();
if(agentsResponse.getStatus() != ResponseStatus.SUCCESS){
log.info("Fail retrieving agent " + agentsResponse.getError().getReasonText());
log.info("More info " + agentsResponse.getError().getErrorCode());
Fail retrieving agent Unable to deserialize result
More info UnexpectedError
I'm using hyperic 4.4.0 so I'm using HQAPI V3.2. My java class is running inside Apache ServiceMix 4.5.3 and I added this library to my Maven repository using the .jar that is provided.
Any help will be so appreciated.
Thank you very much to everybody.

I solved it. After a while I noticed that .xsd file that builds java objects from XML file was not included inside my bundle.

Related

Apache Livy : Could not find or load main class org.apache.livy.server.LivyServer

I am trying to start Apache Livy 0.8.0 server on my windows 10 machine for spark 3.1.2 and hadoop 3.2.1. I am taking help from here.. I have successfully built apache livy using maven (I have attached a of it) But I am not able to run the livy server. When I run it I get the following error -
> starting C:/AmazonJDK/jdk1.8.0_332/bin/java -cp /d/ApacheLivy/incubator-livy-master/incubator-livy-master/server/target/jars/*:/d/ApacheLivy/incubator-livy-master/incubator-livy-master/conf:D:/Program_files/spark/conf:D:/ApacheHadoop/hadoop-3.2.1/etc/hadoop: org.apache.livy.server.LivyServer, logging to D:/ApacheLivy/incubator-livy-master/incubator-livy-master/logs/livy--server.out
ps: unknown option -- o
Try `ps --help' for more information.
failed to launch C:/AmazonJDK/jdk1.8.0_332/bin/java -cp /d/ApacheLivy/incubator-livy-master/incubator-livy-master/server/target/jars/*:/d/ApacheLivy/incubator-livy-master/incubator-livy-master/conf:D:/Program_files/spark/conf:D:/ApacheHadoop/hadoop-3.2.1/etc/hadoop: org.apache.livy.server.LivyServer:
Error: Could not find or load main class org.apache.livy.server.LivyServer
full log in D:/ApacheLivy/incubator-livy-master/incubator-livy-master/logs/livy--server.out
I am using Git bash. If you need more information I will provide
The error got resolved when I used Windows Subsystem for Linux (WSL).

How to connect Opendaylight to Mininet?

I've been working in a simple Hello World project to learn the basics for Opendaylight (I was following this tutorial).
Now I want to connect this build of the controller to a network topology defined by Mininet but this is not working. I read that this may be due to I haven't installed odl-l2switch but when I type feature:list --installed the bundle doesn't appear and when I type feature:install odl-l2switch it doesn't appear neither.
Perhaps it is because the way I created the project:
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/public/ -DarchetypeCatalog=remote -DarchetypeVersion=1.2.2-Boron-SR2
This is strange because I downloaded the Carbon release and I could connect this distribution with Mininet and it worked. Initially I was going to build the hello project in Carbon, the latest distribution, but it didn't work so I did the Hello-World in Boron release.
Can anyone help me?
This is my Github repository
Following this link, the command to generate an ODL app is :
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller
-DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/<Snapshot-Type>/ \
-DarchetypeCatalog=remote -DarchetypeVersion=<Archetype-Version>
where you have to replace as following the proper and :
For the current Master (Carbon) use Snapshot-Type=opendaylight.snapshot Archetype-Version=1.4.0-SNAPSHOT
For the Carbon snapshot use Snapshot-Type=opendaylight.release Archetype-Version=1.3.0-Carbon
For Boron "SR0" use Snapshot-Type=opendaylight.release Archetype-Version=1.2.0-Boron
For Boron SR1 use Snapshot-Type=opendaylight.release Archetype-Version=1.2.1-Boron-SR1
For Boron SR2 use Snapshot-Type=opendaylight.release Archetype-Version=1.2.2-Boron-SR2
For the Boron snapshot use Snapshot-Type=opendaylight.snapshot Archetype-Version=1.2.2-SNAPSHOT
The command you use uses 1.2.2-Boron-SR2 as , but as you use public, which is not the appropriate . Replace public with opendaylight.release, as the above link suggests.
When you run your ODL distribution , you have all the ODL projects which you can install it at anytime. To connect with mininet ,you have to install odl-l2switch-all feature.
In simple Hello project , you dont have l2switch feature to install. thats why you are not able to connect. Anyway you can install the l2switch feature by adding the l2switch dependency in Features/pom.xml and features.xml . You have to add the same odl version of l2switch.Be careful in this.
Please check feature:list | grep "l2switch" is available or not. If so, install it and launch the mininet !! You are done now !

Karaf command not found exception how to troubleshoot?

Downloaded karaf 4.0.9 just following getting started doc but keep getting this
org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: feature:install
whenever i try to do feature:install wrapper from shell
Finding it very difficult to find any help or doc how to trouble shoot? is it a permissions thing? I chowned everything to the same user for simplicity...
Is distribution missing a library? Where do i get it/put it?
New to karaf... Following this: http://karaf.apache.org/manual/latest/#_installation
Just trying to get some basic JDBC/JMS stuff working, install drivers, recieve some msgs, query db, etc
Spent a few hours of reading docs + trial and error to figure this out:
ssh karaf#localhost -p 8101
Will get you full admin shell, apparently this isn't available if you just ./shell from KARAF_HOME/bin
You can check your configurations in users.properties in karaf/etc folder .
Open karaf shell using admin rights.
Start Karaf shell from its bin folder.
Now run karaf console using below command.
ssh username#localhost -p8101
now you can run any command of karaf shell.

Windows Authentication using Apache CFX wsdl2java

I am trying to use Apache CFX wsdl2java command on Mac OSX.
I have run this command ./wsdl2java .
The error I get is the following: WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from :
Caused by : WSDLException: faultCode=PARSER_ERROR: Problem parsing ''.: java.io.IOException: Server returned HTTP response code: 401 for URL:
I believe the reason I get this error is because it requires Windows Authentication. I have tried to search on how to do this, but I have had no luck so far.
I would be extremely thankful for any help or ideas on this topic.
Thanks ahead of time.
If Axis 1.3, you can try
wsdl2java -uri http://user:pass#myapp.example.com/service/myService.wsdl
If Axis 1.4+ you can try
wsdl2java -http-proxy-user user -http-proxy-password pass -uri http://myapp.example.com/service/myService.wsdl
Use singleWsdl rather than wsdl, save it and reference the local copy in command parameters.
use abc/service/myService.singleWsdl rather than abc/service/myService.wsdl

SoapUI "failed to load url" error when loading WSDL

I keep having some weird problems. The main one is that I keep getting the following error when trying to add a WSDL to a new project:
Error loading [https://.../token?wsdl]: java.lang.Exception: Failed to load url; https://.../token?wsdl, 0 -
Here's the message recorded in the error.log file:
java.lang.Exception: Failed to load url; https://.../token?wsdl, 0 -
at com.eviware.soapui.impl.wsdl.support.wsdl.UrlWsdlLoader.load(UrlWsdlLoader.java:184)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader.loadXmlObject(WsdlLoader.java:121)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:535)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:524)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionCache.update(AbstractDefinitionCache.java:97)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:226)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
I verified that the application at that URL is up and running, and I can get to the WSDL from a web browser, but I keep getting this error message no matter what. I am using SoapUI 4.5.0 (32-bit) on a Windows 7 box. I've also tried the 64-bit version with the same results. It happens whether I am on VPN or not.
Do you know why I might be getting this error?
I have had the same problem. I resolved it by disabling the proxy in the SoapUI preferences.
(source : http://www.eviware.com/forum/viewtopic.php?f=13&t=12460)
In my case the server were the service was installed was configured only for TLS. SSL was not allowed. So you have to update SoapUI vmoptions file by adding the server TLS version
-Dsoapui.https.protocols=TLSv1.2
You can find vmoptions file under SoapUI installation folder:
C:\Program Files (x86)\SmartBear\SoapUI-5.0.0\bin\soapUI-5.0.0.vmoptions
I have had similar problems and worked around them by saving the WSDL locally. Don't forget to save any XSD files as well. You may need to edit the WSDL to specify an appropriate location for XSDs.
I got this error when trying to load a WebService implemented in MS Dynamics AX. Because I was connecting via VPN to my network, something went wrong with IPv6 settings. After Googling, I found the solution here: http://support.microsoft.com/kb/929852
In my case the
Error loading [https://.../token?wsdl]: java.lang.Exception: Failed to load url; https://.../token?wsdl, 0
was caused by fake certificate.
If you get the following in browser
"There is a problem with this website’s security certificate."
this is the case.
The resolution was to import a certificate to
C:\Program Files (x86)\SmartBear\SoapUI-5.0.0\jre\lib\security\cacerts
Which is default java used by SOAPUI
This could be a problem with IPV6 address SOAP UI picking. Adding the following JVM option fixed it for me:
-Djava.net.preferIPv4Stack=true
I added it here:
C:\Program Files\SmartBear\soapUI-4.5.2\bin\soapUI-4.5.2.vmoptions
Inside the wsdl file look for the import element, which looks like this :
`<import namespace="nameSpaceValue" location="Users/myname/.../targetxsdName.xsd"/>`
Change the location attribute in the above element to the location of your xsd files stored locally, and it should work.
The following solution helped me:
-Djsse.enableSNIExtension=false
In SoapUI-5.3.0.vmoptions.
This error is due to an erroneous schemaLocation in the WSDL file.
Indicate the correct location (either path on the disk or xsd url) of the xsd file in the wsdl file
exp
<xsd:import namespace="http://xyz:8080/" schemaLocation="http://172.17.16.53:9080/auth/authorizationBS?xsd=1"></xsd:import>
I had this issue when trying to use a SOCKS proxy. It appears that SoapUI does not support SOCKS proxys. I am using the Boomerang Chrome app instead.
I had this error and in my case, the problem was that I was using "localhost" in the URL.
I resolved that changing the localhost word for the respective IP, (Windows + R -> cmd -> ipconfig) then read the IP and write it to the URL replacing the "localhost" word
Close and reopen soapui. Probably is a bug of the application
Update SoapUI version to SoapUI 5.5.0. This error causes when I tried to load wsdl, because of old SoapUI version
If you are running your Web Application with the default port of 8080, please try to change the port to some other value and run your application again and trigger again your SOAPUI request. As you might have history projects in your SOAP UI workspace with port number 8080, might create issues.
My solution was to modify the java.security file:
\SoapUI-5.3.0\jre\lib\security\java.security
Comment code syntax:
#jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
#jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
For java version above 1.8,
Use below command to setup soapUI jar
java -jar --add-modules java.xml.bind --add-modules java.xml.ws <path for jar file+jar file name.jar>

Categories

Resources