i need a Java class to submit tickets to BMC Remedy's but i was getting error could anyone please help me how to resolve that error.
Find the below code:
public class RemedyCreateTicket {
public static void main(String args[]) {
ARServerUser arsServer = new ARServerUser();
Entry args1 = new Entry();
Entry incidentID;
String arForm = "HPD:IncidentInterface_Create";
String arForm1 = "HPD:IncidentInterface";
String IntEntryID = "";
String inciID = "";
try {
//Create Ticket Part
String strLastName = "radadiya";
String strFirstName ="pragnesh";
args1.put(new Integer("1000000076"),new Value("CREATE")); //ticket_action
args1.put(new Integer("1000000018"),new Value(strLastName)); //contact user first_name
args1.put(new Integer("1000000019"),new Value(strFirstName)); //contact user last_name
args1.put(new Integer("7"), new Value("1")); //ticket status
args1.put(new Integer("1000000099"),new Value("3")); //service type
//args1.put(new Integer("1000000163"),new Value("4000")); //impact
args1.put(new Integer("1000000162"),new Value("4000")); //urgency
args1.put(new Integer("1000000000"),new Value("Remedy 7.5 java api test")); //description
args1.put(new Integer("1000000215"),new Value("10000"));
arsServer.setServer("localhost");
arsServer.setUser("pragnesh");
arsServer.setPassword("password");
arsServer.setPort(3389);
arsServer.login();
//arsServer.setPort(3389);
IntEntryID = arsServer.createEntry(arForm, args1);
System.out.println("intEntryID="+IntEntryID);
int[] entryField = {1000000161};
incidentID = arsServer.getEntry(arForm,IntEntryID,entryField);
if(incidentID!=null){
System.out.println(incidentID);
}
System.out.println("------------");
for (Object o : incidentID.entrySet()) {
Map.Entry e = (Map.Entry) o;
System.out.println(e.getKey() + " => " + e.getValue().getClass() + " " + e.getValue());
if(e.getKey().toString().equalsIgnoreCase("1000000161")){
inciID=e.getValue().toString();
}
}
System.out.println("IncidentID = " + inciID);
arsServer.logout();
} catch (ARException e) {
e.printStackTrace();
arsServer.logout();
}
}
}
Here is the stacktrace:
Jun 20, 2017 4:11:55 PM java.util.prefs.WindowsPreferences openKey
WARNING: Could not open windows registry node Software\JavaSoft\Prefs at root 0x80000002. Windows RegOpenKey(...) returned error code 2.
Jun 20, 2017 4:11:55 PM java.util.prefs.WindowsPreferences closeKey
WARNING: Could not close windows registry node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCloseKey(...) returned error code 6.
**ERROR (91): RPC call failed; localhost:3389 Connection reset**
at com.bmc.arsys.apitransport.ApiProxyJRpcBase.convertException(ApiProxyJRpcBase.java:643)
at com.bmc.arsys.api.ProxyJRpc.getRpcClient(ProxyJRpc.java:135)
at com.bmc.arsys.api.ProxyJRpc.<init>(ProxyJRpc.java:67)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.bmc.arsys.apitransport.connection.ApiProxyFactory.createProxyInstance(ApiProxyFactory.java:89)
at com.bmc.arsys.apitransport.connection.ApiProxyFactory.createProxy(ApiProxyFactory.java:160)
at com.bmc.arsys.api.ProxyManager.createProxy(ProxyManager.java:602)
at com.bmc.arsys.api.ProxyPool.createProxy(ProxyPool.java:106)
at com.bmc.arsys.apitransport.connection.ApiProxyPool.get(ApiProxyPool.java:192)
at com.bmc.arsys.apitransport.connection.ApiProxyManager.getProxy(ApiProxyManager.java:210)
at com.bmc.arsys.api.PoolingProxyManager.getProxy(PoolingProxyManager.java:93)
at com.bmc.arsys.apitransport.connection.ApiProxyManager.getProxy(ApiProxyManager.java:164)
at com.bmc.arsys.api.ARServerUser.verifyUser(ARServerUser.java:1085)
at com.bmc.arsys.api.ARServerUser.login(ARServerUser.java:412)
at Remedi.RemedyCreateTicket.main(RemedyCreateTicket.java:46)
Thanks in advance.
This is old but for anyone looking at it after; the code looks fine. ARERROR 91 is typically a networking issue. Port 3389 is the default for Remote Desktop. Therefore, I wonder if you are tunneling to localhost and trying to connect to the Windows machine that you RDP to? Instead of the TCP port the AR Server is actually running on and let in through the Windows firewall?
Related
I have an SAP ASE 16 server on a Windows OS.
I have enabled the java service:
sp_configure 'enable java'
Parameter Name Default Memory Used Config Value Run Value Unit Type
-------------- ----------- ----------- ------------ ------------ ------ ------
enable java 0 0 1 1 switch static
Rows affected (1) Time (0.094 s)
I have created a basic class to test the service (JDBCExamples.java):
import java.sql.*; // JDBC
public class JDBCExamples {
public static void main(String args[]){
if (args.length != 2) {
System.out.println("\n Usage: " + "name secondName \n");
return;
}
try {
String name = args[0];
String secondName = args[1].toLowerCase();
System.out.println("\n HOLA " + name + " " + secondName +" FUNCIONO!!!\n");
} catch (Exception e) {
System.out.println("\n Exception: ");
e.printStackTrace();
}
}
}
I have the class file JDBCExamples.class and I make a file JDBCExamples.jar.
When I try to install the jar file it shows the error message:
instjava -f JDBCExamples.jar -SDEFAULT -Uuser -Ppassword -Ddatabase -new
Server Message: - Msg 5702, Level 10, State 1:
ASE is terminating this process.
I don't see any in log database.
Any idea what the problem is?
Update:
I posted the same problem in https://answers.sap.com/questions/13241081/ase-is-terminating-this-process-when-trying-to-ins.html
In this post suspect the issue is caused by an ASE bug fixed in PL06:
2687973 - NTPCI__exit(1); Native Thread failed to unwind - SAP ASE http://service.sap.com/sap/support/notes/2687973
I have a trial version and I can not download a newer patch (PL06 at least but recommend PL09 as most recent)
Does anyone have this patch?
have problems with my java tests on Cucumber when i run them via jenkins on remote host.
My code:
step:
Given open link from property "bla-blalink"
And type to input with name "UserName" property: "login" on "LoginPage"
element:
#NameOfElement("UserName")
#FindBy(id = "UserName")
public SelenideElement username;
step def:
#And("^type to input with name \"([^\"]*)\" property: \"([^\"]*)\" on \"([^\"]*)\"$")
public void typeToInputWithNamePropertyOn(String nameOfElement, String property, String page) throws InterruptedException, IOException {
sleep(5000);
Properties properties = new Properties();
try (FileReader fileReader = new FileReader(Constants.PROPERTY_PATH)) {
properties.load(fileReader);
}
if ("LoginPage".equals(page)) {
loginPage.get(nameOfElement).sendKeys(properties.getProperty(property));
} else if ("MainPage".equals(page)) {
mainPage.get(nameOfElement).sendKeys(properties.getProperty(property));
} else if ("ActionPage".equals(page)) {
actionPage.get(nameOfElement).sendKeys(properties.getProperty(property));
}
}
configure:
#BeforeClass
static public void setupTimeout() {
/////////////////////////////////for remote runs////////////////////////////////
// Configuration.remote = "http://10.52.185.105:4419/wd/hub";
// Configuration.browser = "chrome";
// DesiredCapabilities capabilities = new DesiredCapabilities();
// capabilities.setBrowserName("chrome");
// capabilities.setCapability(ACCEPT_SSL_CERTS, true);
// WebDriver wd = new RemoteWebDriver(new URL("http://10.52.185.105:4419/wd/hub"), capabilities);
// setWebDriver(wd);
///////////////////////////////////for local runs////////////////////////////
Configuration.timeout = 10000;
System.setProperty("webdriver.chrome.driver", "src/main/resources/webdrivers/chromedriver.exe");
Configuration.browser = "chrome";
What i tried:
it works locally
it works on remote machine(without jenkins)
change window size - doesnt help
change sleep on 35000ms - doesnt help
our jenkins
not started as a service, so i dont know how to allow to interact with elements
output:
T E S T S
Running ru.open.runners.BusinessPortalTest
июн 13, 2018 9:55:27 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer getWebDriver
INFO: No webdriver is bound to current thread: 1 - let's create new webdriver
Starting ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 5610
Only local connections are allowed.
июн 13, 2018 9:55:31 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
июн 13, 2018 9:55:33 AM com.codeborne.selenide.webdriver.WebDriverFactory logBrowserVersion
INFO: BrowserName=chrome Version=67.0.3396.87 Platform=XP
июн 13, 2018 9:55:33 AM com.codeborne.selenide.webdriver.WebDriverFactory createWebDriver
INFO: Selenide v. 4.11.4
июн 13, 2018 9:55:33 AM com.codeborne.selenide.webdriver.WebDriverFactory logSeleniumInfo
INFO: Selenium WebDriver v. 3.12.0 build time: 2018-05-08T14:04:26.12Z
июн 13, 2018 9:55:33 AM com.codeborne.selenide.impl.WebDriverThreadLocalContainer createDriver
INFO: Create webdriver in current thread 1: ChromeDriver -> ChromeDriver: chrome on XP (9879008c2825cc8b84a452e24010d66d)
Failed scenarios:
businessportaltest.feature:440 # Scenario: Change phone number
157222(verify ONLY with payment order)
1 Scenarios (1 failed)
29 Steps (1 failed, 27 skipped, 1 passed)
0m18.951s
java.lang.IllegalArgumentException: ERROR: there is no such element with name Имя пользователя at page ru.open.pageobjects.businessportal.LoginPage
at ru.open.pageobjects.AbstractPage.get(AbstractPage.java:27)
at ru.open.steps.MyStepdefs.typeToInputWithNamePropertyOn(MyStepdefs.java:63)
at ?.And type to input with name "Имя пользователя" property: "login" on "LoginPage"(businessportaltest.feature:443)
remote machine - windows server 2012R
My project crashs when it reach org.omg.CORBA.Object obj = orb.string_to_object(stringTarget);
and throws me an exception that says: "org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No".
Any Ideas in what can cause this error.
The server is Online and I can Ping it.
My IOR file is Updated.
Properties props = System.getProperties();
props.put("org.openorb.PI.FeatureInitializerClass.org.openorb.orb.messaging.MessagingInitializer","");
props.put("ORBClass", "org.openorb.orb.core.ORB");
props.put("iiop.port", ParameterUtil.getInstance().getOrbClientPort());
props.put("iiop.useNativeLibrary", "true");
// Inicializa o ORB
if (orb == null) {
synchronized (semaforo) {
if (orb == null)
orb = ORB.init(args, props);
}
logger.info("ORB inicializado.");
}
FileInputStream file = new FileInputStream(Constantes.IOR_FILE_PATH);
BufferedReader myInput = new BufferedReader(new java.io.InputStreamReader(file));
String stringTarget = myInput.readLine();
logger.debug("IOR used is :" + stringTarget);
org.omg.CORBA.Object obj = orb.string_to_object(stringTarget);
// Definição de politica de timeout no ORB
try {
PolicyManager opm = (PolicyManager) orb.resolve_initial_references("ORBPolicyManager");
Any time_any = orb.create_any();
// convert from 1ms to 100ns
org.omg.TimeBase.TimeTHelper.insert(time_any, orbTimeout * 1000 * 10);
Policy[] policies = new Policy[1];
policies[0] = orb.create_policy(org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE.value, time_any);
opm.set_policy_overrides(policies,
SetOverrideType.ADD_OVERRIDE);
} catch (InvalidName invname_ex) {
logger.error("ORBPolicyManager wasn't found! (" + invname_ex + ")");
} catch (PolicyError pol_ex) {
logger.error("A policy error occured: " + pol_ex + " - Reason Code: " + pol_ex.reason, pol_ex);
} catch (InvalidPolicies invpol_ex) {
logger.error("An invalid policy has been specified: " + invpol_ex);
}
Here is the Full StackTrace
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl <init>
AVISO: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 10.40.56.100; port: 900"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2200)
at com.sun.corba.se.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2221)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:205)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:218)
at com.sun.corba.se.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:101)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:171)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:118)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:74)
at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.resolve(BootstrapResolverImpl.java:107)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.resolver.CompositeResolverImpl.resolve(CompositeResolverImpl.java:22)
at com.sun.corba.se.impl.orb.ORBImpl.resolve_initial_references(ORBImpl.java:1151)
at com.gvt.oss.nec.pool.net.dslam.ZhoneGateway.init(ZhoneGateway.java:232)
at com.gvt.oss.nec.pool.net.dslam.ZhoneGateway.<init>(ZhoneGateway.java:194)
at com.gvt.oss.nec.pool.factory.GatewayFactory.getSession(GatewayFactory.java:12)
at com.gvt.oss.nec.pool.facade.SessionExecutionFacade.openSession(SessionExecutionFacade.java:27)
at corba.Corba.main(Corba.java:27)
Caused by: java.net.ConnectException: Connection refused: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:500)
at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
at com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl.createSocket(DefaultSocketFactoryImpl.java:60)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:188)
... 15 more
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.gvt.oss.nec.pool.util.Datasource.loadDataSource(Datasource.java:54)
at com.gvt.oss.nec.pool.util.Datasource.getConnection(Datasource.java:73)
at com.gvt.oss.nec.pool.business.ManagerAudit.<init>(ManagerAudit.java:46)
at com.gvt.oss.nec.pool.business.ManagerAudit.getInstance(ManagerAudit.java:65)
at com.gvt.oss.nec.pool.facade.SessionExecutionFacade.corbaExecCommandSession(SessionExecutionFacade.java:105)
at corba.Corba.main(Corba.java:28)
15/05/2014 10:03:18 corba.Corba main
GRAVE: null
com.gvt.oss.nec.pool.exception.RemotePoolException: Erro geral ao processar requisição de comando Corba: null
at com.gvt.oss.nec.pool.facade.SessionExecutionFacade.corbaExecCommandSession(SessionExecutionFacade.java:102)
at corba.Corba.main(Corba.java:28)
You need to define this property:
java.naming.factory.initial
as per the error message
Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
java.naming.factory.initial
Run orb start orbd -ORBInitialPort 1050 or tnameserv -ORBInitialPort 1050
Run your class client and server with: -ORBInitialPort 1050 -ORBInitialHost localhost
a similar problem
I tried to create a lotus notes client using Java. Now, I have a problem to list all the user defined databases. What I tried to do is
// testing purpose
private void printAllDb() throws NotesException
{
DbDirectory dir = session.getDbDirectory(host);
String server = dir.getName();
if(server.equals(""))
{
server = "Local";
}
System.out.println("database direcory list on server (" + server + ")");
Database db = dir.getFirstDatabase(DbDirectory.DATABASE);
do
{
System.out.println("file name: " + db.getFileName().toUpperCase() + " - " + db.getTitle());
} while((db = dir.getNextDatabase()) != null);
}
However, the program will throw the exception:
Exception in thread "main" NotesException: Server access denied
at lotus.domino.NotesExceptionHelper.read(Unknown Source)
at lotus.domino.NotesExceptionHolder._read(Unknown Source)
at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at lotus.domino.corba._IDbDirectoryStub.getFirstDatabase(Unknown Source)
at lotus.domino.cso.DbDirectory.getFirstDatabase(Unknown Source)
at nz.co.sylresearch.sylsearch.agents.lotusnotes.LotusNotesAPIHandler.printAllDb(LotusNotesAPIHandler.java:58)
at nz.co.sylresearch.sylsearch.agents.lotusnotes.LotusNotesAPIHandler.main(LotusNotesAPIHandler.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
The issue is pretty clear. You are getting an access denied error to the server. The tricky part now is figuring out why.
You should start with making sure the username and password used to create the session object is correct. Then make sure that user has access to the server and has access to run Java code on the server. You'll have to check the server document in the Directory for that.
I have launch mongodb server:
[demas#arch.local.net][~]% mongod --dbpatmongod --dbpath /home/demas/temp/
Mon Apr 19 09:44:18 Mongo DB : starting : pid = 4538 port = 27017 dbpath = /home/demas/temp/ master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
Mon Apr 19 09:44:18 db version v1.4.0, pdfile version 4.5
Mon Apr 19 09:44:18 git version: nogitversion
Mon Apr 19 09:44:18 sys info: Linux arch.local.net 2.6.33-ARCH #1 SMP PREEMPT Mon Apr 5 05:57:38 UTC 2010 i686 BOOST_LIB_VERSION=1_41
Mon Apr 19 09:44:18 waiting for connections on port 27017
Mon Apr 19 09:44:18 web admin interface listening on port 28017
I have created documents by console client:
[demas#arch.local.net][~]% mongo
MongoDB shell version: 1.4.0
url: test
connecting to: test
type "help" for help
> db.some.find();
{ "_id" : ObjectId("4bcbef3c3be43e9b7e04ef3d"), "name" : "mongo" }
{ "_id" : ObjectId("4bcbef423be43e9b7e04ef3e"), "x" : 3 }
Now I am trying to work with MongoDb from Java:
import com.mongodb.*;
import java.net.UnknownHostException;
public class test1 {
public static void main(String[] args) {
System.out.println("Start");
try {
Mongo m = new Mongo("localhost", 27017);
DB db = m.getDB("test");
DBCollection coll = db.getCollection("some");
coll.insert(makeDocument(10, "James", "male"));
System.out.println("Finish");
}
catch (UnknownHostException ex) {
ex.printStackTrace();
}
catch (MongoException ex) {
ex.printStackTrace();
}
}
public static BasicDBObject makeDocument(int id, String name, String gender) {
BasicDBObject doc = new BasicDBObject();
doc.put("id", id);
doc.put("name", name);
doc.put("gender", gender);
return doc;
}
}
But execution stops on line coll.insert():
[demas#arch.local.net][~/dev/study/java/mongodb]% javac test1.java
[demas#arch.local.net][~/dev/study/java/mongodb]% java test1
Start
There are not messages from mogodb server regarding accepted connection. Why?
Hm...
If I change the line:
Mongo m = new Mongo("localhost", 27017);
to:
Mongo m = new Mongo();
all works fine.
Check your /etc/hosts file to make sure that localhost resolves to 127.0.0.1.
Typically, it will contain a line like:
127.0.0.1 localhost.localdomain localhost
Try to change localhost to 127.0.0.1. May be it will be ok.