Detecting server name in java
I need to programmatically detect the name or ip of the server my java code is running on. Does anyone know how to do this?
Thanks,
-G
If you are not behind a router, this code work well:
import java.net.*;
import java.util.Enumeration;
public static InetAddress getInternetAddress()
try
InetAddress address;
for(Enumeration e1 = NetworkInterface.getNetworkInterfaces(); e1.hasMoreElements();)
for(Enumeration e2 = ((NetworkInterface)(e1.nextElement())).getInetAddresses(); e2.hasMoreElements();)
address = (InetAddress)e2.nextElement();
if( !address.isLoopbackAddress() && !address.isSiteLocalAddress() )
return address;
}catch(Exception e){}
return null;
}
Similar Messages
-
Changed server name, reconfiged emca, still getting java errors on console
I installed 10gr2 with local database control only, and had all working fine. I then moved the server into production after testing and changed the server name. Of course this changed all the settings for dbconsole so I ran the emca config again from some info I got off of this forum a week or so ago. I can't seem to find that thread any more, and I need to get this working. I could not find any more references to the old server name, but the java error is still showing one. I can bring up the login page and login, but then it wont display any info.
I've been searching to see what I need to do to totally re-install the local database control component but can't seem to find anything. I am also going to eventually have grid control running on another machine as well, but I imagine that I still have to have all the proper things in place on this server before I can connect either thru grid control or locally in any case.REPOSITORY_URL=http://winms-wwscale.millsite.net:5500/em/upload/
I searched every file in the <server url> directory and changed any references to the old servername to the new one. The only ones that showed up were for isqlplus items.
I am pretty sure I have run the "emca dbcontrol db -repos recreate" command, but perhaps I'll do it again. I also have a thread going on this in metalink and one suggestion is to do the following:
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
A. Drop the repository manually using following procedure.
Stop the DB Console if not already stoped: $ORACLE_HOME/bin/emctl stop dbconsole
Log on in sqlplus as sys user and run the following commands:
a. drop user sysman cascade;
b. drop role MGMT_USER;
c. drop user MGMT_VIEW cascade;
d. drop public synonym MGMT_TARGET_BLACKOUTS;
e. drop public synonym SETEMVIEWUSERCONTEXT;
(Note If any of the above statement failed and saying object doesn't exist just skip that
statement)
B. Drop the DB Control configuration files.
Remove the following directories:
$rm -rf $ORACLE_HOME/<HOSTNAME_SID>
$rm -rf $ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_<HOSTNAME_SID>
On Windows systems just delete the folders above from the Explorer.
You have to replace the values in the <> with the correct values from your environment .
The shutdown and startup restrict seems a tad severe to me, I'm thinking thats if others may be trying to access the database control page while you are doing all of this. -
How to detect whether browser's java script disabled or not from server
How to detect whether browser's java script disabled or not from server side
I would use a hidden parameter created by a javascript. if this is null, javascript is disabled...
-
NNTP Server Name for Sun's Java Newsgroups
Please can someone tell me the above NNTP server name ? I'd like to make use of Outlook Express to read & post to the java newsgroups.
TIA.There are some free news servers but usualy they don't allow postings.
The best think you can do is to contact your ISP and ask them if they have NNTP server or at least NNTP proxy which you can use. -
WebtopNaming - can not find server name for server ID
We have a LB, and web servers in front of OpenSSO app servers in our environment.
OpenSSO debug log CoreSystem fills up with lot of errors like these:
ERROR: WebtopNaming.getServerFromID() can not find server name for server ID : 07
com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server.
Sometimes, it even complains about a server id (07 in the following trace) which doesn't even exist in the Site Id Table.
There are no changes in the configuration. DNS is properly configured and all the servers and their connectivity are available. CoreSystem throws these errors even after a restart of opensso app servers.
Any ideas about the root cause?
amNaming:05/13/2011 10:22:37:009 AM PST: Thread[WebContainer : 0,5,main]
Server Id Table -> {%protocol://%host:%port%uri/AssertionManagerServlet/AssertionManagerIF=iplanet-am-naming-samlassertionmanager-url, http://host4.company.com:8080/openSSO=04, com.iplanet.dpro.profile.agent.ProfileService=iplanet-am-naming-profile-class, %protocol://%host:%port%uri/SecurityTokenManagerServlet/SecurityTokenManagerIF=iplanet-am-naming-securitytokenmanager-url, %protocol://%host:%port%uri/authservice=iplanet-am-naming-auth-url, %protocol://%host:%port%uri/sts=sun-naming-sts-url, %protocol://%host:%port%uri/SAMLAwareServlet=iplanet-am-naming-samlawareservlet-url, http://host5.company.com:8080/openSSO=05, com.sun.identity.authentication.server.AuthXMLHandler=iplanet-am-naming-auth-class, com.sun.identity.policy.remote.PolicyRequestHandler=iplanet-am-naming-policy-class, %protocol://%host:%port%uri/loggingservice=iplanet-am-naming-logging-url, %protocol://%host:%port%uri/jaxrpc/=iplanet-am-naming-jaxrpc-url, %protocol://%host:%port%uri/FSAssertionManagerServlet/FSAssertionManagerIF=iplanet-am-naming-fsassertionmanager-url, %protocol://%host:%port%uri/identity/=sun-naming-idsvcs-rest-url, 03,05,04,02|03,01|03=iplanet-am-platform-site-id-list, %protocol://%host:%port%uri/identityservices/=sun-naming-idsvcs-jaxws-url, %protocol://%host:%port%uri/sts/mex=sun-naming-sts-mex-url, %protocol://%host:%port%uri/profileservice=iplanet-am-naming-profile-url, %protocol://%host:%port%uri/SAMLPOSTProfileServlet=iplanet-am-naming-samlpostservlet-url, 02|02,01|01,05|05,04|04=iplanet-am-platform-lb-cookie-value-list, %protocol://%host:%port%uri/SAMLSOAPReceiver=iplanet-am-naming-samlsoapreceiver-url, https://host4.company.com:8443/openSSO=01, com.sun.identity.log.service.LogService=iplanet-am-naming-logging-class, %protocol://%host:%port%uri/sessionservice=iplanet-am-naming-session-url, https://host5.company.com:8443/openSSO=02, %protocol://%host:%port%uri/policyservice=iplanet-am-naming-policy-url, iplanet-am-naming-service=serviceObjectClasses, com.iplanet.dpro.session.service.SessionRequestHandler=iplanet-am-naming-session-class, https://opensso-qa.company.com:443/openSSO=03}
amNaming:05/13/2011 10:22:37:009 AM PST: Thread[WebContainer : 0,5,main]
Site Id Table -> {03=03, 02=03, 01=03, 05=05, 04=04}
amNaming:05/13/2011 10:22:37:009 AM PST: Thread[WebContainer : 0,5,main]
Platform Servers -> [https://opensso-qa.company.com:443/openSSO, https://host5.company.com:8443/openSSO, https://host4.company.com:8443/openSSO, http://host4.company.com:8080/openSSO, http://host5.company.com:8080/openSSO]
amNaming:05/13/2011 10:22:37:009 AM PST: Thread[WebContainer : 0,5,main]
Platform Server IDs -> [03, 02, 01, 04, 05]
amNaming:05/13/2011 10:22:37:010 AM PST: Thread[WebContainer : 0,5,main]
ERROR: WebtopNaming.getServerFromID() can not find server name for server ID : 07
com.iplanet.services.naming.ServerEntryNotFoundException: Cannot find server.
at com.iplanet.services.naming.ServerEntryNotFoundException.<init>(ServerEntryNotFoundException.java:52)
at com.iplanet.services.naming.WebtopNaming.getServerFromID(WebtopNaming.java:709)
at com.iplanet.dpro.session.SessionID.setServerID(SessionID.java:380)
at com.iplanet.dpro.session.SessionID.parseSessionString(SessionID.java:363)
at com.iplanet.dpro.session.SessionID.getSessionServerID(SessionID.java:261)
at com.iplanet.dpro.session.service.SessionService.isLocalSite(SessionService.java:881)
at com.iplanet.dpro.session.Session.getSessionServiceURL(Session.java:1197)
at com.sun.identity.authentication.UI.LoginServlet.initializeRequestContext(LoginServlet.java:153)
at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.java:578)
at com.iplanet.jato.ApplicationServletBase.doGet(ApplicationServletBase.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)Thank You for the response.
Here is my site configuration in OpenSSO:
There are 4 servers in the two opensso hosts (2 secure, 2 non secure)
Servers:
http://host4.company.com:8080/openSSO
http://host5.company.com:8080/openSSO
https://host4.company.com:8443/openSSO
https://host5.company.com:8443/openSSO
Only one site with secure URLs is configured
Sites:
site1
Primary URL: https://opensso-qa.company.com:443/openSSO
Assigned Servers:
https://host4.company.com:8443/openSSO
https://host5.company.com:8443/openSSO
From the CoreSystem log, Server ID definitions are:
https://host4.company.com:8443/openSSO=01
https://host5.company.com:8443/openSSO=02
https://opensso-qa.company.com:443/openSSO=03
http://host4.company.com:8080/openSSO=04
http://host5.company.com:8080/openSSO=05
Sometimes it throws an exception with existing server IDs. But sometimes it also complains about non existing server IDs. -
So I think I know what caused this problem, but I can't figure out how to make it stop...
When I go to print, if I try to click on the pop-up to change the default printer setting, there's a LONG delay, then I get a dialog that says:
Connection Failed
The server "name" may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection, then try again.
Then there's another delay and I get the message a second time. I can then select any of my printer settings and print fine, it's just an annoying delay if I click on that pop-up accidentally or need to change it.
I have a new iMac and I migrated from my old G5. The "name" of the server it is seeking is my old G5, so that must be in the settings somewhere, but I can't find it. I tried going into the Print & Fax settings in System Preferences, deleting the printer there, and then re-adding, but that didn't clear it up.
Thanks for any insight you can provide!
--JohnHmm, well, this stopped working again for me. I tried swapping ethernet and re-installing the Airport client update - to no avail. I could always see my Mac shares from PCs though. However, I have (for now) managed to connect to the PC using ip address rather than name even though finder quite clearly sees the name. Does your printer connection work by ip rather than name ? I'm going to play name lookup detective for a bit now - it's some kind of Netbios name lookup issue I guess as I've no local DNS service. resolv.conf is apparently not used so a bit of learning to do! ...
... nmblookup seems to work but nslookup doesn't. Looks like SL connect via Finder isn't using nmblookup properly and I can't see how to make that work. When this gets reported enough it should get a publicised work-round or a fix. If only I can get dig/nslookup to slave out to nmblookup ...must be something I can configure for that ?? -
My Application is handled by three load balanced servers.I have a functionality in which first i send a request for a document printing.This request is posted in Database.Then a backend script runs and takes each requets in DB and executes and creates a file and places in server space. This works fine when i have only one server.But when i have load balanced servers user can give request for print from one server(he does know where from he is giving) and backend shell scripts can take the OPEN record from DB and execute in another server.So user is not able to find the document thought his request is processed.I have tried to know the DNS names of teh server whose are taking the print request so that i can track. But when i check with ServletRequest.getServerName() but i always get the application URL not teh specific load balance server name. I am tryong my luck with java.net.InetAddress
Hey i could solve this problem. i have used java.net.InetAddress class and its methods to know the system name on which my code is executing.
Viswanath -
The server name osr_server1 is unknown to the administration server
I have successfully installed OSR and created WLS Domain using config.cmd. But when I try to start by command line (startManagedWebLogic.cmd osr_server1) I got the error "server is unknown". I have no idea what could be wrong.
Basically I followed http://niallcblogs.blogspot.com.br/2010/09/oracle-service-registry-and-osb11g.html.
The complete command line is:
C:\Oracle\Middleware\user_projects\domains\base_domain\bin>startManagedWebLogic.
cmd osr_server1
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=
48m -XX:MaxPermSize=128m
WLS Start Mode=Development
CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\sys_manifest_classpa
th\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_oepe180\profiles\default\sys_mani
fest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_ocp371\profiles\defau
lt\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_adfr1111\p
rofiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK
160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\
Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\fe
atures\weblogic.server.modules_10.3.6.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server
\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Or
acle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Oracle\MIDDLE~1\WLSERV
~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\x
qrl.jar;C:\Program Files\Java\jdk1.7.0_09\jre\lib
PATH=C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\native;C:\Oracle\MIDDLE~1
\patch_oepe180\profiles\default\native;C:\Oracle\MIDDLE~1\patch_ocp371\profiles\
default\native;C:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\native;C:\Orac
le\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server
\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1\bin;C:\Oracle\MIDDLE~1\JDK160~1\jre\b
in;C:\Oracle\MIDDLE~1\JDK160~1\bin;C:\Oracle\product\11.1.0\client_1\bin;C:\Wind
ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowe
rShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program File
s\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Micr
osoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft Visual Studio 9.0\Co
mmon7\IDE\PrivateAssemblies\;c:\Program Files\Microsoft SQL Server\90\Tools\binn
\;C:\Program Files\Java\jdk1.7.0_09\bin;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\nat
ive\win\32\oci920_8
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http:\\hostname:port\console *
starting weblogic with Java version:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode)
Starting WLS with line:
C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThre
shold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -Dweblogic.Name=osr_server1 -D
java.security.policy=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -D
weblogic.security.SSL.trustedCAKeyStore="C:\Oracle\Middleware\wlserver_10.3\serv
er\lib\cacerts" -Xverify:none -da -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.
3 -Dwls.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDD
LE~1\WLSERV~1.3\server -Dweblogic.management.discover=false -Dweblogic.managem
ent.server=http://SISTEMA026:7001 -Dwlw.iterativeDev=false -Dwlw.testConsole=fa
lse -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_
wls1036\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_oepe
180\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_ocp371\p
rofiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_adfr1111\prof
iles\default\sysext_manifest_classpath weblogic.Server
<19/11/2012 18h40min53s BRST> <Info> <Security> <BEA-090905> <Disabling CryptoJ
JCE Provider self-integrity check for better startup performance. To enable this
check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<19/11/2012 18h40min53s BRST> <Info> <Security> <BEA-090906> <Changing the defau
lt Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable
this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<19/11/2012 18h40min53s BRST> <Info> <WebLogicServer> <BEA-000377> <Starting Web
Logic Server with Java HotSpot(TM) Client VM Version 20.4-b02 from Sun Microsyst
ems Inc.>
<19/11/2012 18h40min53s BRST> <Info> <Security> <BEA-090065> <Getting boot ident
ity from user.>
Enter username to boot WebLogic server:weblogic_osr2
Enter password to boot WebLogic server:
<19/11/2012 18h41min23s BRST> <Info> <Management> <BEA-141107> <Version: WebLogi
c Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050 >
<19/11/2012 18h41min24s BRST> <Emergency> <Management> <BEA-141151> <The admin s
erver could not be reached at http://SISTEMA026:7001.>
<19/11/2012 18h41min24s BRST> <Critical> <WebLogicServer> <BEA-000362> <Server f
ailed. Reason:
There are 1 nested errors:
weblogic.management.ManagementException: The server name osr_server1 is unknown
to the administration server. Check if restart is required.
at weblogic.management.provider.internal.RuntimeAccessImpl.initialize(Ru
ntimeAccessImpl.java:447)
at weblogic.management.provider.internal.RuntimeAccessService.start(Runt
imeAccessService.java:49)
at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesMan
ager.java:461)
at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServ
icesManager.java:166)
at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:881)
at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:568)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:469)
at weblogic.Server.main(Server.java:71)
>
<19/11/2012 18h41min24s BRST> <Notice> <WebLogicServer> <BEA-000365> <Server sta
te changed to FAILED>
<19/11/2012 18h41min24s BRST> <Error> <WebLogicServer> <BEA-000383> <A critical
service failed. The server will shut itself down>
<19/11/2012 18h41min24s BRST> <Notice> <WebLogicServer> <BEA-000365> <Server sta
te changed to FORCE_SHUTTING_DOWN>Yes, there are the tags you have suggested. The complete config.xml is below.
I tried:
C:\Oracle\Middleware\user_projects\domains\base_domain\bin>startManagedWebLogic.
cmd osr_server1
When asked the user, I tried the node-manager-username weblogic_osr2 and the admin user but I always received the error: The server name osr_server1 is unknown to the administration server.
<?xml version="1.0" encoding="UTF-8" ?>
- <domain xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd" xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<name>base_domain</name>
<domain-version>10.3.6.0</domain-version>
- <security-configuration>
<name>base_domain</name>
- <realm xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator">
<sec:authentication-provider xsi:type="wls:default-authenticatorType" />
- <sec:authentication-provider xsi:type="wls:default-identity-asserterType">
<sec:active-type>AuthenticatedUser</sec:active-type>
</sec:authentication-provider>
<sec:role-mapper xsi:type="wls:default-role-mapperType" />
<sec:authorizer xsi:type="wls:default-authorizerType" />
<sec:adjudicator xsi:type="wls:default-adjudicatorType" />
<sec:credential-mapper xsi:type="wls:default-credential-mapperType" />
<sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType" />
<sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
<sec:name>myrealm</sec:name>
- <sec:password-validator xsi:type="pas:system-password-validatorType">
<sec:name>systemPasswordValidator</sec:name>
<pas:min-password-length>8</pas:min-password-length>
<pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
</sec:password-validator>
</realm>
<default-realm>myrealm</default-realm>
<credential-encrypted>{AES}LArhcMlb7Jdt2zQbNnzLdi3luhgdNyPJS1JIVb9H+VWi5XcC9SP4SQa/8mp/SKI072DoA/sGnzvYDqpn3OxQl3pE0LxaXoOmYNnWsSv/keo8I0rMvrXWJXqn4fbSl9bd</credential-encrypted>
*<node-manager-username>weblogic_osr2</node-manager-username>*
<node-manager-password-encrypted>{AES}1SioVLWu3mu/u6y/You1ZGeBTXJHfUCq+loZSCVOdSE=</node-manager-password-encrypted>
</security-configuration>
- <server>
<name>AdminServer</name>
<listen-address />
</server>
- <server>
*<name>osr_server1</name>*
<listen-port>7101</listen-port>
<listen-address>sistema026.br-lihi.libertyinternational.com</listen-address>
</server>
- <embedded-ldap>
<name>base_domain</name>
<credential-encrypted>{AES}C+0tyHN5wihXjDHQKdQt/5PvYpko8rS0PL6wSSvp3sHLZscRB1RjSNL8MXfHHjwW</credential-encrypted>
</embedded-ldap>
<configuration-version>10.3.6.0</configuration-version>
- <app-deployment>
<name>registry</name>
<target>osr_server1</target>
<module-type>war</module-type>
<source-path>C:\Oracle\Middleware\registry111/conf/porting/weblogic/build/registry.war</source-path>
<deployment-order>195</deployment-order>
<security-dd-model>DDOnly</security-dd-model>
</app-deployment>
<admin-server-name>AdminServer</admin-server-name>
- <jdbc-system-resource>
<name>jdbc/registryDS</name>
<target>osr_server1</target>
<descriptor-file-name>jdbc/registry-20121119171422-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
</domain> -
Getting error when i am giving the server name in JDBC
Hi All,
When i am trying to connect to JDBC then i am getting the error in Servername
{color:#3366ff}********************INPUT OF Testing.java************************
package com.fidelity.ereview.utils;{color}
{color:#3366ff}import java.io.*;
import java.sql.*;{color}
{color:#3366ff}public class Testing {
public static void main(String[] args) throws SQLException {{color}
{color:#3366ff} Connection con;
SQLServerDataSource ds = new SQLServerDataSource();
ds.setServerName("01HW059726\SQL2K5"); {color:#ff0000}//here getting error{color}
ds.setPortNumber(1433);
ds.setUser("eReview");
ds.setPassword("Password123");
ds.setDatabaseName("migration");
con = ds.getConnection();
if (con != null) {
System.out.println("Successfully connected");
else
System.out.println("Not Successfully connected");
Kindly anybody tell me that how shell i give the server name (My server name is :01HW059726\SQL2K5) in the
ds.setServerName???{color}Replace \ in server name with \\ like
01HW059726*{color:#ff0000}\\{color}*SQL2K5 -
How to get server name and port of OSB server in a proxy service ?
I need to get the server name and port of the OSB server inside a proxy service. How can I get this?
You may use java callout for this purpose -
How to get ServerName and ApplicationName in OSB (ALSB) ?
Regards,
Anuj -
Acrobat Pro XI
We are getting a new server. I am trying to figure out the best way to edit hyperlinks (to locations on the LAN) in existing pdf files. Most of these files were created from Word files with links, and then converted to pdf (Acrobat Pro 7).
Word offers ways (macros) to batch edit all of the hyperlinks in all documents in a folder, but there seems to be no built-in way to do this in Acrobat. Assuming this is correct, Is there a way to edit all of the hyperlinks in a single pdf file in one shot (replace the server name)? Failing that, is there a way to edit just the server name in an individual link? I know I can "edit" a hyperlink by replacing it with a new one (drilling down to the file location each time), but I would much prefer just to replace the old server name with the new one.
If all else fails I could create new pdf files from the Word document, but there are features of the pdf files that would need to be replicated in the new files. For instance, there is a notice (I used a form field) that printed copies are for reference only. There is also a process (using Java script, which I do not know, but I received help in a forum years ago) to cause the date of printing to appear in a location of my choosing. Maybe Acrobat XI offers a way to do this, but it was inflexible and unsuitable to my needs in Acrobat 7, which is why I went the route I did.
The point is that it would be less effort to edit the server name (if that is possible) than to create all new pdf files. However, if I need to drill down to the file locations one at a time in the existing pdf files I would do better to start over.Thanks for the reply. You confirmed what I suspected. Links have always been clunky to manage in Acrobat.
Related question: The links were generated originally from Word documents that have links. I was able to generate a list of all links used in the Word documents (I used a macro to loop through a folder and extract the links), and am now copying and pasting from that listing into the hyperlinks in the pdf file. I use the Link tool, right click and select Properties, and edit from there. Some of the links repeat from document to document (or within a document). There is a drop-down listing of hyperlinks added or revised in the current Acrobat session (at least), but only the leftmost characters appear in the box, often not enough to identify the link. Is there a way to see the entire file name? -
Where can i get the report server name in Reports 10g
Where can i get my report server name in 10G ?
Thanks ..
When i opened the bat file :
i did not find any report server name ...
This is my file :-
@echo off
REM $Header: rwdiag.bat 13-may-2005.03:21:21 sunaraya Exp $
REM
REM rwdiag.bat
REM
REM Copyright (c) 2005, Oracle. All rights reserved.
REM
REM NAME
REM rwdiag.bat - rw diagnostic tool
REM
REM DESCRIPTION
REM Script to run the diagnostic tool used to locate servers / monitor packets on the network
REM
REM NOTES
REM Usage: rwdiag.bat -find <server name> | -findAll [-conf <config file>] [-timeout <timeout in sec>]
REM
REM Usage: rwdiag.bat -monitor [-log <logfile>] [-conf <config file>]
REM
REM MODIFIED (MM/DD/YY)
REM sunaraya 05/13/05 - Added rwrun.jar to the classpath for bug 4361664
REM sunaraya 04/22/05 - Provided execute permission to the script for bug 4323789
REM sunaraya 04/14/05 - sunaraya_bug-4221172
REM sunaraya 04/14/05 - Creation
REM
set ORA_HOME=C:\ORANT
if "%ORA_HOME%"=="" goto ERROR
set CLASSPATH=%ORAHOME%\jlib\zrclient.jar;%ORA_HOME%\reports\jlib\rwrun.jar
%ORA_HOME%\jdk\bin\java -DORACLE_HOME=%ORA_HOME% -classpath %_CLASSPATH% oracle.reports.utility.DiagServerLocator %*
goto END
:ERROR
echo "ORACLE_HOME is not set"
echo.
:END -
How to get managed server name in Weblogic10.2 ?
Hi
I want to get managed server name from a cluster in a servlet or util project class whom that one is called by ?
Do I have to implement any interface or I have to extends a class ? Please help me to resolved.
ThanksHere is a snippet of code that I use in WL10 MP1 that works fine:
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.naming.InitialContext;
String managedServerName = null;
InitialContext ctx = null;
try {
//fetch managed server name by accessing the
//RuntimeServerMBean using the
//MBeanServer interface
ctx = new InitialContext();
MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
ObjectName service = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
managedServerName = (String) server.getAttribute(service, "ServerName");
} catch (Exception ex) {
//error occurred
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (Exception dontCare) { -
Hi!
I followed the following steps to configure a clustered environment with two machines:
- installation of Oracle WebLogic Server 11g (10.3.3) in machine A and B
- creation of a domain using configuration wizard (in machine A)
- distributed domain using pack (machine A) and unpack (machine B)
- startup of node manager in both machines (both reachable)
- creation of a Managed Server 1 in machine A
- creation of a Managed Server 2 in machine B
- startup of the Managed Server 1 in machine A (it works fine)
- startup of the Managed Server 2 in machine B , it fails with the following error:
<Nov 30, 2010 12:39:28 PM WET> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:
There are 1 nested errors:
weblogic.management.ManagementException: [Management:141223]The server name server_migration_2 specified with -Dweblogic.Name does not exist. The configuration includes the following servers {AdminServer}.
at weblogic.management.provider.internal.RuntimeAccessImpl.<init>(RuntimeAccessImpl.java:149)
at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:41)
at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:461)
at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:166)
at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:803)
at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:493)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:446)
at weblogic.Server.main(Server.java:67)
>
<Nov 30, 2010 12:39:28 PM WET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
The config.xml file located at ../user_projects/domains/mydomain/config/ in Machine 1 has the full environment setup, however the same file on machine 2 only has admin server configuration.
Why it happens? These two files must be synchronized? The config.xml in the Machine 2 is used by who? Admin server uses this file?
Thanks a lot
A.If your newly created managed server is on a 3rd machine you will still need to 'pack/unpack', to transport the configuration files to the new machine.
If your 3rd managed server share domain_home with an already existing managed server you wont need to do this. In this case when a new managed server is created in the admin console, the admin server will propogate the change to the existing managed server which will update its configuration files in its local domain_home. The new server when starting will pick up this updated details from the shared location and will be able to start.
You were doing the pack after creating admin server alone. So the config files transported to remote machine has only details of Admin Server and using that you were trying to start the managed server, where i it clearly failed saying that it can't find that managed server name in its configuration.
If you have adavance knowledge of how many managed servers you need to create , at the time of domain creation, the right way is to configure all the man servers in the domain configuration wizard and then use pack/unpack to distribute the configuration files to each of the remote machine where the managed servers run.
Hope it makes sense. -
Server name, port from OSB proxy and BPEL processes
How do I read the server name, port and any other server related information from OSB proxy and BPEL processes?
http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Java/BEA_WebLogic/Q_24480613.html
ObjectName service = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
InitialContext ctx = new InitialContext();
MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
ObjectName rt = (ObjectName)server.getAttribute(service,"ServerRuntime");
System.out.println("Server Name : "+server.getAttribute(rt,"Name"));
System.out.println("Server Address : "+server.getAttribute(rt,"ListenAddress"));
System.out.println("Server Port : "+server.getAttribute(rt,"ListenPort"));
ctx.close();
By the way, it tool 10 seconds on google ...
Maybe you are looking for
-
How to keep your apps when you upgrade your iphone
Hi there everyone. Like many of you peeps out there I have my sights set on the iPhone 5. I presently have a 3GS. A friend at work had the same but this week upgraded to the iPhone 4. One thing we spoke about and didn't have a clue about was, when yo
-
Time capsule wireless range is very poor & often weak
My TC has a very limited distance that it covers. S bad that I have 2 Airport Express for boosters/extenders to have most of my house covered (yes, a small portion of my house is still not covered). Is there something I have missed in settings restri
-
Consolidate library only moving some files
I tried consolidating an iTunes Library to a new folder on an external drive, but it is only copying over about 1/3 of the files that are in the iTunes Music folder on my internal drive. How can I correct this situation? Please help, this is urgent.
-
When I delete an ongoing event in my calendar it reappears again after a few seconds. How do I fix this?
-
Hello, RH 8 and outputting a CHM. When I generate CHM, I get an output message (in the Pod) that tells me 'the following files were not compiled.' I've checked the files and they seem fine to me. In essence, they are no different than the myriad file