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
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?
PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource();
try {
LOGGER.info("testing Pool creation ::::" );
LOGGER.info("testing Pool creation :::: in test" );
if (StringUtils.isEmpty(poolname)) {
throw new UCPConnectionException("Pool name derived from Sys-config was not valid...");
}
if (StringUtils.isEmpty(url)|| StringUtils.isEmpty(user) || StringUtils.isEmpty(pswd)) {
throw new UCPConnectionException(
"Invalid Connection Parameters.Terminating the creation of Pool DataSource");
}
//String ONS_CONFIG = "nodes=hract21:6200,hract22:6200,hract23:6200";
//pds.setONSConfiguration ( ONS_CONFIG);
//pds.setFastConnectionFailoverEnabled( true);
pds.setConnectionFactoryClassName(factoryName);
pds.setURL(url);
pds.setUser(user);
pds.setPassword(DatabaseConnectionHelper.decryptPassword(pswd));
pds.setConnectionPoolName(poolname);
pds.setInitialPoolSize(50);
// Default is 0. Set the minimum number of connections
// that is maintained by UCP at runtime.
pds.setMinPoolSize(50);
// Default is Integer.MAX_VALUE (2147483647). Set the maximum number of
// connections allowed on the connection pool.
pds.setMaxPoolSize(200);
// Default is 30secs. Set the frequency in seconds to enforce the timeout
// properties. Applies to inactiveConnectionTimeout(int secs),
// AbandonedConnectionTimeout(secs)& TimeToLiveConnectionTimeout(int secs).
// Range of valid values is 0 to Integer.MAX_VALUE. .
pds.setTimeoutCheckInterval(25);
// Default is 0. Set the maximum time, in seconds, that a
// connection remains available in the connection pool.
pds.setInactiveConnectionTimeout(50);
// Set the JDBC connection properties after pool has been created
Properties connProps = new Properties();
connProps.setProperty("fixedString", "false");
connProps.setProperty("remarksReporting", "false");
connProps.setProperty("restrictGetTables", "false");
connProps.setProperty("includeSynonyms", "false");
connProps.setProperty("defaultNChar", "false");
connProps.setProperty("AccumulateBatchResult", "false");
// JDBC connection properties will be set on the provided
// connection factory.
pds.setConnectionProperties(connProps);
// hardcoded values end
pds.setValidateConnectionOnBorrow(true);
// pds.setConnectionProperties(connProps);
LOGGER.info("Establishing Pool creation ::::::::::::::::::::::::::::::::::::: ::::" + poolname);
UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager()
.createConnectionPool((UniversalConnectionPoolAdapter) pds);
LOGGER.info("Starting Pool creation ::::" + poolname);
UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager().startConnectionPool(poolname);
} catch (Exception ue) {
ue.printStackTrace();
LOGGER.error("Unable to create/Start the UCP connection pool due to " + ue.getMessage());
throw new UniversalConnectionPoolException("Exception occured when trying to create the pool ");
}
return pds;
============================================
ERROR | Nov 24, 11:00:31] com.oracle.cegbu.microservice.sync.service.db.connection.ManageDBConnectionPool:121 - Unable to create/Start the UCP connection pool due to
oracle.ucp.UniversalConnectionPoolException: Failed to create initialPoolSize connections while starting a pool: java.lang.NullPointerException
at oracle.ucp.util.UCPErrorHandler.newUniversalConnectionPoolException(UCPErrorHandler.java:336) ~[oracle.ucp.jar:19.3.0.0.0]
at oracle.ucp.util.UCPErrorHandler.throwUniversalConnectionPoolException(UCPErrorHandler.java:59) ~[oracle.ucp.jar:19.3.0.0.0]
at oracle.ucp.common.Core.initialize(Core.java:1783) ~[oracle.ucp.jar:19.3.0.0.0]
at oracle.ucp.common.UniversalConnectionPoolBase.start(UniversalConnectionPoolBase.java:705) ~[oracle.ucp.jar:19.3.0.0.0]
at oracle.ucp.jdbc.oracle.OracleJDBCConnectionPool.start(OracleJDBCConnectionPool.java:129) ~[oracle.ucp.jar:19.3.0.0.0]
at oracle.ucp.admin.UniversalConnectionPoolManagerBase.startConnectionPool(UniversalConnectionPoolManagerBase.java:363) ~[oracle.ucp.jar:19.3.0.0.0]
at com.oracle.cegbu.microservice.sync.service.db.connection.ManageDBConnectionPool.createConnectionPool(ManageDBConnectionPool.java:118) [sync-client-service.jar:20.12.0.0]
at com.oracle.cegbu.microservice.sync.service.akka.process.SyncProcessSingleton.createPools(SyncProcessSingleton.java:99) [sync-client-service.jar:20.12.0.0]
at com.oracle.cegbu.microservice.sync.service.akka.process.SyncProcessSingleton.poolInitlize(SyncProcessSingleton.java:77) [sync-client-service.jar:20.12.0.0]
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?
I am trying to create a logical replication slot via the java PostgreSQL 42.0.0.jre7 API and this is my code :
String url = "jdbc:postgresql://localhost:5432/sampledb?characterEncoding=utf8";
Properties props = new Properties();
PGProperty.USER.set(props, "postgres");
PGProperty.PASSWORD.set(props, "root");
PGProperty.ASSUME_MIN_SERVER_VERSION.set(props, "9.6");
PGProperty.REPLICATION.set(props, "true");
PGProperty.PREFER_QUERY_MODE.set(props, "simple");
DriverManager.registerDriver(new org.postgresql.Driver());
Connection con = DriverManager.getConnection(url, props);
PGConnection replConnection = con.unwrap(PGConnection.class);
replConnection.getReplicationAPI()
.createReplicationSlot()
.logical()
.withSlotName("logical_replication_slot")
.withOutputPlugin("test_decoding")
.make();
but when i run it I get this exception saying that I have an encoding problem.
Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x71 0x75
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:297)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260)[423:org.postgresql.jdbc41:42.0.0.jre7]
at org.postgresql.replication.fluent.logical.LogicalCreateSlotBuilder.make(LogicalCreateSlotBuilder.java:48)[423:org.postgresql.jdbc41:42.0.0.jre7]
at com.soprahr.hub.replication.postgresql.activator.Activator.start(Activator.java:41)[424:com.soprahr.hub.replication.postgresql:0.0.1.SNAPSHOT]
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)[org.apache.felix.framework-5.6.1.jar:]
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2226)[org.apache.felix.framework-5.6.1.jar:]
... 16 more
This is my postgres config i have tried sql_ascii, utf8 for client encoding but always the same error :
client_encoding = windows-1251 # actually, defaults to database
# encoding
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'French_France.1252' # locale for system error message
# strings
lc_monetary = 'French_France.1252' # locale for monetary formatting
lc_numeric = 'French_France.1252' # locale for number formatting
lc_time = 'French_France.1252' # locale for time formatting
You just need to change the settings into postgres.conf
lc_messages = 'English_United States.1252'
lc_monetary = 'English_United States.1252'
lc_numeric = 'English_United States.1252'
lc_time = 'English_United States.1252'
default_text_search_config = 'pg_catalog.english'
And don't forget to comment "client_encoding = windows-1251".
This should work!
I was trying to run a simple jdbc code [ using jdk 1.6, oracle 10g] as,
package javaapplication2;
import java.text.*;
import java.sql.*;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.BufferedWriter;
/**
* #author animark
*/
public class CallableStatementEx1 {
public CallableStatementEx1(){;}
public static void main(String s[]) throws Exception {
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Connection con=null;
String url= "jdbc:oracle:thin:#//localhost:1521:orcl" ;
con = DriverManager.getConnection(url,"scott","password");
String query="update emp set HIREDATE=?,ENAME=? where empno=?";
//Step1: Get PreparedStatement
PreparedStatement ps=con.prepareStatement(query);
//Prepare java.sql.Date object
/*
This logic shows how to convert simple String that is in
dd-MM-yyyy format into Date object
*/
SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
java.util.Date d=sdf.parse("26-12-2001");
java.sql.Date newdate=new java.sql.Date(d.getTime());
//Step2: set parameters
ps.setDate(1,newdate);
ps.setString(2,"animark");
ps.setInt(3,7839);
//Step3: execute the query
int i=ps.executeUpdate();
System.out.println("record updated count: "+i);
con.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}//main
}//class
The code is getting compiled properly. But when I'm trying to run it, i'm getting the following exception..
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at javaapplication2.CallableStatementEx1.main(CallableStatementEx1.java:19)
I've checked the oracle services and all of them are up and running.
Also, please find the contents of other files as
=================================================================================
tnsnames.ora:
# tnsnames.ora Network Configuration File: C:\oraclexe\app\oracle\product\10.2.0\server\BIN\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
====================================================================================
sqlnet.ora
# sqlnet.ora Network Configuration File: C:\oraclexe\app\oracle\product\10.2.0\server\BIN\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
================================================================================
# listener.ora Network Configuration File: C:\oraclexe\app\oracle\product\10.2.0\server\BIN\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server\BIN)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
===============================================================================
I'm being able to connect to the instance "orcl" using credentials "scott/password", but when i'm trying to connect using statement
SQL> connect sys/password#orcl as sysdba
I'm getting the following error..
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor.
I've also run LSNRCTL for orcl and found
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 22-JUL-2012 13:42:30
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
Please help me if I'm doing anything wrong here.
Try taking the // out of the connection URL. Instead of
String url= "jdbc:oracle:thin:#//localhost:1521:orcl" ;
try
String url= "jdbc:oracle:thin:#localhost:1521:orcl" ;