Highlighted
Absent Member.
Absent Member.
349 views

ArcSight Express WebAPI Trouble

Hi,

We have an ArcSight Express Appliance 4.0 and we are trying to use ArcSight WebAPI from java project. Before we begin, we got the SDK from appliance ($ARCSIGHT_HOME/utilities/sdk). We imported all of the jars to the our eclipse project build path. However when we run the project we get exception. Even we tried to run sample example code from the examples section of the SDK. Again we got exception. SOAP Code snippets from WebAPI documents also fails. Exception message is that:



Exception in thread "main" java.lang.RuntimeException: Could not create dispatch

at com.arcsight.coma.client.ws.jaxws.JaxWSClientFactory.getDispatch(JaxWSClientFactory.java:80)

at com.arcsight.coma.client.ws.jaxws.JaxWSClientFactory.createClient(JaxWSClientFactory.java:50)

at com.arcsight.coma.client.ws.WSClientFactory.createClient(WSClientFactory.java:79)

at com.arcsight.product.core.service.v1.client.ws.LoginServiceClientFactory.createClient(LoginServiceClientFactory.java:26)

********************************

*********************************

Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions

java.util.List is an interface, and JAXB can't handle interfaces.

this problem is related to the following location:

at java.util.List

at private java.util.HashMap com.arcsight.product.core.service.v1.axis2.jaxws.GroupServiceGetAllRightsByGroupTypeResponse._return

at com.arcsight.product.core.service.v1.axis2.jaxws.GroupServiceGetAllRightsByGroupTypeResponse

at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)

at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at javax.xml.bind.ContextFinder.newInstance(Unknown Source)

at javax.xml.bind.ContextFinder.newInstance(Unknown Source)

at javax.xml.bind.ContextFinder.find(Unknown Source)

at javax.xml.bind.JAXBContext.newInstance(Unknown Source)

at javax.xml.bind.JAXBContext.newInstance(Unknown Source)

at com.arcsight.coma.client.ws.jaxws.JaxWSClientFactory.getDispatch(JaxWSClientFactory.java:77)

... 5 more

Are we doing something wrong? What can be the cause of this exception and how can I solve this issue?

Any help will be appreciated.

Tags (1)
0 Likes
Reply
4 Replies
Highlighted
Absent Member.
Absent Member.

I don't know if this will help you.  I was having the same error but then I added the Apache Axis JAR's to my project library and now I get a completely different mystifying error:

Start login ...

log4j:WARN No appenders could be found for logger (org.apache.axis2.metadata.registry.MetadataFactoryRegistry).

log4j:WARN Please initialize the log4j system properly.

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Invalid chunk header

  at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326)

  at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1326)

  at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.getFaultResponse(BaseDispatch.java:852)

  at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.invoke(BaseDispatch.java:204)

  at com.arcsight.coma.client.ws.jaxws.ServiceClientBase.invoke(ServiceClientBase.java:33)

  at com.arcsight.product.core.service.v1.client.ws.jaxws.LoginServiceClient.login(LoginServiceClient.java:26)

  at esmreport.example.ESMReportExample.main(ESMReportExample.java:53)

Java Result: 1

Here are my imports:

import java.io.ByteArrayOutputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.net.URL;

// JAXB Issue (java.util.List is an interface, and JAXB can't handle interfaces)

import javax.xml.bind.JAXBContext;

import javax.xml.bind.Marshaller;

import com.arcsight.product.core.service.v1.client.ws.LoginServiceClientFactory;

import com.arcsight.product.core.service.v1.client.ws.api.LoginService;

import com.arcsight.product.manager.resource.service.v1.client.ws.ArchiveReportServiceClientFactory;

import com.arcsight.product.manager.resource.service.v1.client.ws.api.ArchiveReportService;

0 Likes
Reply
Highlighted
Absent Member.
Absent Member.

I am experiencing the same issue.  Has anyone found a resolution?

- Brandon

0 Likes
Reply
Highlighted
Senior Member..
Senior Member..

Which version of java sdk do you use?

ESM API works with 1.6 only.

0 Likes
Reply
Highlighted
Respected Contributor.
Respected Contributor.

hi all,  here are my 1.63 cents.

HashMap error looks as a JDK version issue to me.

Login and Invalid Header error is something different,  I had a similar error when imported org.apache.axis2 library instead of one provided with the ArcSight API

Eclipse looks cool because it is a hip tool.  However, I would suggest to get your code working in a good old NetBeans,  just as they taught us in school.  After you have your basics working there,  then move onto Eclipse ( if you want to hang out with the cool kids ).  Point is,  you may not need to get all fancy stuff Eclipse has to offer and stick with what works - NetBeans.

Yarick

0 Likes
Reply
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.