ArrayField and state of child
I got this problem:
I want the array fieild to show the elementa of some columns depending on a
boolean attribute of the mapped class:
if true col 6 and 7 (datafield) will be invisible an col 5 visible and vice
versa.
Col 5 is a scrolllist so I need to populate each time the widget with
different data.
Everything functions well (htanks to the help found on the list) but I see
a strange quirk:
When I set to true two consecutive rows and then I scroll the arrayfield
the widget of col 6 and 7 that were invisible
pop up (only on one of the row), they are just a dirty paint as they cannot
be selected (but show the hidden data)
Any suggestion on this.
I use R3.f
Here is a code fragment of the method
The array field has 5 rows
Method popProv just populate the scrolllist with the array of listelement
passed as parameter.
mw1 : fieldWidget;
mw2 : fieldWidget;
mw3 : fieldWidget;
myRow : integer = 1;
for i in <arfProc>.TopRow to <arfProc>.TopRow + 4 do
mw1 = <arfProc>.BodyGrid.GetChildInCell(myRow ,5);
mw2 = <arfProc>.BodyGrid.GetChildInCell(myRow ,6);
mw3 = <arfProc>.BodyGrid.GetChildInCell(myRow ,7);
if arfProc.codFilter then
mw1.State = FS_UPDATE;
popProv(PI_sclProv = ScrollList(mw1),
PI_arrPr = arfProc[i].arrProv);
mw2.State = FS_INVISIBLE;
mw3.State = FS_INVISIBLE;
else
mw1.State = FS_INVISIBLE;
mw2.State = FS_UPDATE;
mw3.State = FS_UPDATE;
end if;
myRow = myRow + 1;
end for;
Thanks
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
Apple does not sell Macs for any other purpose than for their own software, especially Mac OS X. It is not available without Leopard, soon to be Snow Leopard.
Nothing has changed regarding installing or hosting other OSs.
Apple posts no information for expanding the RAM capacity. You would need to check with the Hackintosh community for that information.
Dah•veed
Why do you reward points?
The reward system helps to increase community participation. When a community member gives a reward to another member for providing helpful advice or a solution to his or her question, the recipient's points will help increase his or her status level within the community.
Similar Messages
-
Re: ArrayField FieldWidget.State
Hello Joseph,
you get old. You don't see additional lines of code which makes
the whole ArrayField FS_UPDATE and FS_INACTIVE. After this lines the
original state of every widget is overridden :-) .
Sorry for this unnecessary questions and answers :-))))
Joseph Mirwald
At 12:31 31.07.98 +0200, you wrote:
Hello forte-users,
i have a problem using ArrayField and set the state of
direct mapped FieldWidget's.
Dependent on a flag in the array i would set the (e.g.) 6th field-state to
FS_INACTIVE or FS_UPDATE. To do this with an normal DataType like
DecimalNullable worked well. I use:
specialField : FieldWidget;
for row in 1 to ....
specialField=af.BodyGrid.GetChildInCell(row=row,column=6); // Get the widget
end for;
and dependent on the flag I set the state:
if flag[row] then
specialField.State=FS_UPDATE;
else
specialField.State=FS_INACTIVE;
end if;
But now i need a virtual attribute of type integer instead of the
DecimalNullable and i implement it well. But now the mechanism to set the
usage-state does not work anymore.
1.How do you implement ArrayField's with field-dependent state's ?
I use also the same mechanism to set the NextTabField and PrevTabField
property but if a widget is outside the visible grid there is no chance to do
this.
2. Have someone implement a special Prev-/NextTabField attribute
written which is able to set the Prev-/NextTabField also outside the visible
part of the ArrayField? (To slide within tool-code down and up does not
help. The last setting on a slided AF is the general setting for the others.
Maybe the MatrixField is the problem).Xavier,
Create a method called GetWidgetState on your window which contains
the following:
GetWidgetState(w:fieldwidget):
if w.state = FS_USAGESTATE then
return w.GetStateForUsage(self.window.usage);
else
return w.state;
end if;
By default, a widget state equals FS_USAGESTATE(0) which is the
state set in the window workshop for the particular window usage.
Unless you specifically change the state, it will always be 0 and you
have to fetch the actual state using GetStateForUsage on the widget.
Hope this helps.
Peter
Hi every one
I'm looking for something to check the current state of the fieldWidget.
The State attribute (integer) determines how a widget reacts to user
actions and how it is displayed. It's a virtual attribute. No problem to
setting it with variable, but I don't find the way to test it like :
myFieldWidget.State <> FS_INACTIVE
(myFieldWidget.State & FS_INVISIBLE) <> 0
but this doesn't work
could you help me...?
Thank
Xavier Michel
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
Get Free Email and Do More On The Web. Visit http://www.msn.com
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
I have deleted time machine preferences...restarted the modem a bunch of times, restored time capsule to it's original settings...after I first set it up in Airport Ulitity its shows a page quickly that states there is a internet problem, but the page quickly goes away before I can read what it says exaclty and states the internet connection problem is resolved...
However it's not resolved, I'm also having trouble doing a back up to my time capsule...I recently purchased a new macbook and retrieved/restore what was on the time capsule to the new computer...that worked fine...wireless worked fine...however when I tried to back up the new macbook...it would faii stating that there isn't enough room on the TC to do a back up...
I didn't end up keeping the new macbook, I was just using it/trying it out while my current macbook pro was being repaired (logic board)
Ever since I got my current macbook back from repair...my backups have failed due to their not being enough space to perform the back up...in the past the back ups would happen and old back ups would be replaced...
I think this has to do with my current computer having a new name after the repair..."Adam's macbook pro 2" vs "Adam's macbook pro"
The internet was working fine wirelessly through the TC a day ago, but it wasn't allowing my other laptop that was connected via ethernet access to the internet...I had a self assigned IP address error then...I don't have that problem now, but it's not transmitting internet at all...even though it's in a solid green state.
I have no problem completely wiping out my TC including the previous back ups on it...just don't know how to go about it...I have restored it to factory settings a bunch of times and created the network from scratch...just hasn't fixed the issue
Is there more prefences files I should deleteIf the modem is also a router, either use the modem in bridge and run pppoe client on the TC.. that is assuming ADSL or similar eg vdsl. If it is cable service.. and the modem is a router, then bridge the TC.. go to internet page and select connect by ethernet and below that set connection sharing to bridge.
Please tell us more about the modem if the above gives you issues. -
Implicit vs explicit close of resultsets and statements?
Hi friends.I am a newbie Java Developer..Okay Here goes
I have just made a LAN based Java application using Swing,JDBC with backend as MS-Access..The backend is on a shared network drive..
The application is distributed as jar files on the LAN PCs..
Everywhere I have connected to the database I have just closed the connection explicitly like this
con.close();
I do not close the associated resultset and statement explicitly
The specification says associated statements and resultsets close when you close
the connection,even if you don't explicitly close them
Also I am not using connection pool..its simple basic connection using DriverManager
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbcdbcSN name";
String user = "";
String pw = "";
con = DriverManager.getConnection(url, user, pw);
Statement stmt = con.createStatement();
String select = "" ;
ResultSet rows = stmt.executeQuery(select);
On the net everyone says to explicitly close everything..but I did not know that
earlier..
If specification says everything closes on
closing connection why do ppl insist on closing everything explicitly..?
Or is this driver dependent..don't the drivers go through the specification..
My driver is the Sun JDBC ODBC bridge.....
I found this method DriverManager.setLogwriter()
It prints out a trace of all JDBC operations..
So I ran a sample program with this method included...
I redirected output to a log file..
In that program I just explicitly close the connection without closing the
statements and resultsets explicitly...
After running the program and seeing the log I saw that the statements
and resultsets are closed implicitly If I just close the connection explicitly..
I am putting the log file and the code..
Have a look at the end of the log file..
Code
import java.sql.;
import java.io.;
class gc4test
public static void main(String args[])
Connection con = null;
try
FileWriter fwTrace = new FileWriter("c:\\log.txt");
PrintWriter pwTrace= new PrintWriter(fwTrace);
DriverManager.setLogWriter(pwTrace);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:pravahcon";
String user = "admin";
String pw = "ash123";
con = DriverManager.getConnection(url, user, pw);
Statement stmt = con.createStatement();
Statement stmt1 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Statement stmt2 = con.createStatement();
Statement stmt3 = con.createStatement();
Statement stmt4 = con.createStatement();
Statement stmt5 = con.createStatement();
Statement stmt6 = con.createStatement();
Statement stmt7 = con.createStatement();
String select = "SELECT * FROM Users" ;
ResultSet rows = stmt.executeQuery(select);
ResultSet rows1 = stmt1.executeQuery(select);
while(rows.next())
con.close();
catch (ClassNotFoundException f)
System.out.println(f.getMessage());
System.exit(0);
catch (SQLException g)
System.out.println(g.getMessage());
System.exit(0);
catch (Exception e)
System.out.println(e.getMessage());
System.exit(0);
End of Log File
Setting statement option (SQLSetStmtAttr), hStmt=50275112, fOption=25
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
Fetching (SQLFetch), hStmt=50274224
End of result set (SQL_NO_DATA)
*Connection.close
8 Statement(s) to close
*Statement.close
Free statement (SQLFreeStmt), hStmt=50281544, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@2e7263
*Statement.close
Free statement (SQLFreeStmt), hStmt=50277224, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@1bf216a
*Statement.close
*ResultSet.close
*ResultSet has been closed
Free statement (SQLFreeStmt), hStmt=50274224, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@156ee8e
*Statement.close
Free statement (SQLFreeStmt), hStmt=50280464, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@c20e24
*Statement.close
Free statement (SQLFreeStmt), hStmt=50278304, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@12ac982
*Statement.close
*ResultSet.close
*ResultSet has been closed
Free statement (SQLFreeStmt), hStmt=50275112, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@e0e1c6
*Statement.close
Free statement (SQLFreeStmt), hStmt=50276144, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@6ca1c
*Statement.close
Free statement (SQLFreeStmt), hStmt=50279384, fOption=1
deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@1389e4
Disconnecting (SQLDisconnect), hDbc=50271048
Closing connection (SQLFreeConnect), hDbc=50271048
Closing environment (SQLFreeEnv), hEnv=50270880
So like what these implicitly closed statements and resultsets are different from explicitly closed
resultsets and statements..?Please do not crosspost/doublepost the same question again. It is rude in terms of netiquette.
Stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5393387&messageID=10745794#10745794]. -
Closing resultset and statements
Hi!
I just got told that I do not need to close my resultsets and statements in the code, it it enough that the connection are closed. Is this correct?
Eg:
public method myMethod() {
ResultSet rs = null;
Statement sqlStmt = null;
try {
query = "SELECT something";
rs = sqlStmt.executeQuery(query);
if (rs.next())
do something...
// close rs
if (rs != null) {
rs.close();
rs = null;
sqlStmt.close();
sqlStmt = null;
} // end try
catch (errors)...
finally {
if (con != null) { <-- Is this line enough to close everything and release connections?
try {
con.close();
catch (exception)...
} // end finallyNo, you have to explicitly close the resultset, statement, and connection in order to release resources allocated to each of them. Closing the connection will only relase the connection, not the resultset, and statement.
you could do all of it in the finally as follows:
finally {
try {
if (rs != null) {
rs.close();
if (stmt != null) {
stmt.close();
if (conn != null) {
conn.close();
} catch (Exception e) {}
also there is no need to set rs = null, stmt = null after the close() -
I tried updating my iphone 4 to 7.1.1 and it went straight into recovery mode.... I finally got my iphone out of recovery mode, but now it won't accept my Icloud info and states "An error occrured while trying to save the Icloud account?" What do I do????
Same situation. I installed iOS 8 beta 4 on my iPhone 5 and a few days later my iCloud account disappeared. My contacts and calendar entries are gone.
My Mac Mini and MacBook do sync as they should with iCloud.
When I try to log in to iCloud on the iPhone (the username shows "[email protected]" and password shows "required"), I put in my username and password and tap "Sign In", It says "Verifying" at the top and after a while checkmarks appear next to my username and password. Then I get an error message saying "An error occurred while trying to save the iCloud account". If I tap OK the message goes away, leaving my username and password intact (checkmarks are now gone). If I tap "Sign In" again I get a message saying " '[email protected]' is Already Added. This iCloud account has already been added to your iPhone". If I go back to Settings and then go into iCloud again it's not set up and appears as I stated at the beginning of this paragraph.
Nothing works and the sync does not occur. Contacts are empty and Calendar has no entries. -
Retrieve city and state from zip code that is entered by user
I am trying to use AJAX to retrieve city and state from a table based on a zip code that is entered by the user. Two are text fields (zip code and city) and one is a SELECT field (state).
1. I defined an application item called TEMPORARY_APPLICATION_ITEM.
2. I defined an application process called SET_CITY_STATE as follows:
a. Process point: on demand
b. type: anonymous block
c. process text:
<pre>
DECLARE
v_city VARCHAR2 (100);
v_state VARCHAR2 (2);
CURSOR cur_c
IS
SELECT city, state
FROM ZIP
WHERE zip = v ('TEMPORARY_APPLICATION_ITEM');
BEGIN
FOR c IN cur_c
LOOP
v_city := c.city;
v_state := c.state;
END LOOP;
apex_util.set_session_state('P2_CO_CITY',v_city);
apex_util.set_session_state('P2_CO_STATE',v_state);
EXCEPTION
WHEN OTHERS
THEN
apex_util.set_session_state('P2_CITY','Unknown city');
apex_util.set_session_state('P2_STATE',null);
END;
</pre>
3. Javascript is defined in the region header:
<pre>
<script language="JavaScript" type="text/javascript">
<!--
function pull_city_state(pValue){
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
'APPLICATION_PROCESS=Set_City_State',0);
if(pValue){
get.add('TEMPORARY_APPLICATION_ITEM',pValue)
}else{
get.add('TEMPORARY_APPLICATION_ITEM','null')
gReturn = get.get('XML');
get = null;
//-->
</script>
</pre>
4. In the HTML Form Element Attributes of the P2_CO_ZIP text item: onchange="pull_city_state(this.value)";
The city and state are not being populated. I checked the select statement and it is retreiving the city and state in SQL WORKSHOP > SQL COMMANDS.
I would like to use it for the mailing address as well, so I would need to make the application process / javascript a bit more generic to be used in two places.
I placed the application on apex.oracle.com:
Workspace: RGWORK
Application: Online Certification Application (28022)
Can someone assists, please.
Thank you,
Robert
Edited by: sect55 on Jun 2, 2009 4:11 PMHi Robert,
Try using XML instead of session state -
Change the application on demand process with the following script -
>
DECLARE
v_city VARCHAR2 (100);
v_state VARCHAR2 (2);
CURSOR cur_c
IS
SELECT city, state
FROM ZIP
WHERE zip = v ('TEMPORARY_APPLICATION_ITEM');
BEGIN
FOR c IN cur_c
LOOP
v_city := c.city;
v_state := c.state;
END LOOP;
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
HTP.prn ('<body>');
HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
HTP.prn ('<item id="P2_CO_CITY">' || v_city || '</item>');
HTP.prn ('<item id="P2_CO_STATE">' || v_state || '</item>');
HTP.prn ('</body>');
EXCEPTION
WHEN OTHERS
THEN
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
HTP.prn ('<body>');
HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
HTP.prn ('<item id="P2_CITY">' || 'Unknown city' || '</item>');
HTP.prn ('<item id="P2_STATE">' || '' || '</item>');
HTP.prn ('</body>');
END;
>
in your javascript make sure you typing the application process name correctly as it is case sensitive.
Hope this helps,
Regards,
M Tajuddin
web: http://tajuddin.whitepagesbd.com -
What are the best apps to monitor tests and emails on childs phone
what are the best apps to monitor tests and emails on childs phone?
You could simply log into your child's email with the password that the two of you agree upon, and monitor the emails manually. As for the texts, you could purchase a separate device, and use the child's Apple ID to monitor the iMessages. For SMS/MMS, no way to monitor it. You'll have to use the app called 'Random Parental Inspections'.
-
What's the difference between "PreparedStatement" and "Statement"?
What's the difference between "PreparedStatement" and "Statement"?
Which is better??????Read the docs for the two classes. The differences are apparent there.
Which one is better depends on your needs. I think that constructing and executing a PreparedStatement can be a bit less performant than just a Statement, if you're only executing the query one time. But I don't think that difference will normally be noticable in the context of a given application.
Additionally, if you have to pass any dates or strings to the query, you'll want PreparedStatement's parameters, rather than trying to format and escape things in the query string. -
Vendor Master - street addr and PO box/different city and state
Issue: Check print for vendor is wrong when both street and PO Box address are populated in Vendor Master. Print Preview shows correct PO Box with correct city and state, but when check prints using the PO Box, it uses the city from the street address. Please help.
Example:
Street address for vendor is Westport, CN.
PO Box for vendor is Newark, NJ.
Edited by: Jan Ackerman on Sep 17, 2008 10:48 PM Meant to type CT, not CN.If we change the Print Program to use the PO Box, will the SAP Print Program still know to use the street address for vendors that don't have a PO Box? Please confirm. Thank you!
-
How to get the name of the city and state of the current location of the user
Hi all
i need to get the name of the city and state (full address) of the current location of the user.
need help.The best way to do this is to put the monitor name as a property bag in the script and pass that to your event details. Otherwise, we're looking at querying the database each time the monitor generates an event, and this is overhead that is really not
necessary. The other option, which is just even worse in terms of performance, is to use powershell to query the SDK for the monitor name. Both of these options are not going to be a good solution, because now you need to implement action accounts that can
either query the database or the sdk.
Jonathan Almquist | SCOMskills, LLC (http://scomskills.com) -
Printing the Name and State of Servers
Hi,
Please can somebody help in executing the below mentioned code which will print the name and state of the servers.
Below Java file taken from the following location : http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/core/index.html
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
public class PrintServerState {
private static MBeanServerConnection connection;
private static JMXConnector connector;
private static final ObjectName service;
// Initializing the object name for DomainRuntimeServiceMBean
// so it can be used throughout the class.
static {
try {
service = new ObjectName(
"com.bea:Name=DomainRuntimeService,Type=weblogic.management.
mbeanservers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());
* Initialize connection to the Domain Runtime MBean Server
public static void initConnection(String hostname, String portString,
String username, String password) throws IOException,
MalformedURLException {
String protocol = "t3";
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
port, jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
* Print an array of ServerRuntimeMBeans.
* This MBean is the root of the runtime MBean hierarchy, and
* each server in the domain hosts its own instance.
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service,
"ServerRuntimes");
* Iterate through ServerRuntimeMBeans and get the name and state
public void printNameAndState() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
System.out.println("got server runtimes");
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT,
"Name");
String state = (String) connection.getAttribute(serverRT[i],
"State");
System.out.println("Server name: " + name + ". Server state: "
+ state);
public static void main(String[] args) throws Exception {
String hostname = args[0];
String portString = args[1];
String username = args[2];
String password = args[3];
PrintServerState s = new PrintServerState();
initConnection(hostname, portString, username, password);
s.printNameAndState();
connector.close();
When executing the above mentioned code getting the following error
Exception in thread "main" java.net.MalformedURLException: Bad IPv6 address: t3:
//localhost
at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
at javax.management.remote.JMXServiceURL.validate(Unknown Source)
at javax.management.remote.JMXServiceURL.<init>(Unknown Source)
at PrintServerState.initConnection(PrintServerState.java:39)
at PrintServerState.main(PrintServerState.java:84)
Caused by: java.net.UnknownHostException: t3://localhost
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
... 6 moreHi,
Copy the below code and save it as PrintServerState.java,
I also have copied the code from
http://docs.oracle.com/cd/E21764_01/web.1111/e13728/accesswls.htm#i1116377
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
import java.lang.*;
public class PrintServerState {
private static MBeanServerConnection connection;
private static JMXConnector connector;
private static final ObjectName service;
// Initializing the object name for DomainRuntimeServiceMBean
// so it can be used throughout the class.
static {
try {
service = new ObjectName(
"com.bea:Name=DomainRuntimeService,Type=weblogic.management.
mbeanservers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());
* Initialize connection to the Domain Runtime MBean Server
public static void initConnection(String hostname, String portString,
String username, String password) throws IOException,
MalformedURLException {
String protocol = "t3";
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
port, jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
* Print an array of ServerRuntimeMBeans.
* This MBean is the root of the runtime MBean hierarchy, and
* each server in the domain hosts its own instance.
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service,
"ServerRuntimes");
* Iterate through ServerRuntimeMBeans and get the name and state
public void printNameAndState() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
System.out.println("got server runtimes");
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT,
"Name");
String state = (String) connection.getAttribute(serverRT[i],
"State");
System.out.println("Server name: " + name + ". Server state: "
+ state);
public static void main(String[] args) throws Exception {
String hostname = args[0];
String portString = args[1];
String username = args[2];
String password = args[3];
PrintServerState s = new PrintServerState();
initConnection(hostname, portString, username, password);
s.printNameAndState();
connector.close();
Now compile it as javac -d . PrintServerState.java
Then Execute WL_HOME/weblogic92/server/bin/setWLSEnv.sh
Now Execute ur class file generated as
java -classpath .:WL_HOME/weblogic92/server/lib/wljmxclient.jar PrintServerState ipaddress port username password
The output will be as follows
Server name: Server3. Server state: RUNNING
Server name: Server2. Server state: RUNNING
Server name: Server1. Server state: RUNNING
Server name: Server4. Server state: RUNNING
Regards
Fabian -
Hey
When signing into icloud with my apple Id on a second hand Ipad 2 i bought it won't let me and states 'The maxium number of free accounts have been activated on this ipad. How do i sign into icloud then? HelpWelcome to the Apple Community.
Make sure you are using the sign in option and not trying to create a new one. If you need to create a new ID...
Unfortunately once all the 3 iCloud accounts have been created on your device, you cannot create any more regardless of what you do. You will need to re-use one of the accounts that you have already created or create your new account on another iOS device or Mac computer. -
1. Hello
2. Problem with old laser printer and compatibility.
3. My computer is a iMac
4. running 10.6.8
5. printer: Lexmark Optra S 1255
6. bought a IEEE 1284 printer cable
7. installed drivers
8. When I add the printer, it just swirls and state"printer offline"
9. Any advise would be greatly appreciated?Explain #8.
Did you restart after adding the drivers?
If you open the System Profiler, under Firewire or Printers what do yo see?
(Apple Menu/About this Mac/More Info/Firewire or Printer)
If it sees them then you know it's a configuration problem. -
hi, my firefox and safari are both having difficulty loading certain parts of web pages. previous to this my firefox would freeze and state that a script was not responding. i would stop the script and reload the page and everything would be fine. now though the pages just load very very slowly or load leaving out certain pictures and video content. i've tried clearing my cache's and cookies, resetting my browser etc, but it seems like its a system issue as both safari and firefox are having issues. i've run Avast to screen for malware and it came up empty. any suggestions?
10.4.8's been a pain for Networking... not sure of all the reasons though, or whether all the complaints might not be MS working around Bugs/Non-compliance, but at this point I think you should get Applejack...
http://www.versiontracker.com/dyn/moreinfo/macosx/19596
After installing, boot holding down CMD+s, then when the prompt shows, type in...
applejack AUTO
Then let it do all 5 of it's things.
Fixes a lot of problems, and besides, if your Mac ever gets to the point it won't Boot... this is a life saver!
After you run that... let's see where we are.
BTW, several ISPs seem to have trouble with their DNS Servers lately, might try these insead...
208.67.222.222
208.67.220.220
Maybe you are looking for
-
Internal Links in HTML Document Not Working Correctly in PDF
I have an HTML document that contains internal links (basically a Table of Contents). When the document is displayed in a browser, the internal links work correctly. However, when I use Acrobat 8 Professional to create a PDF version from the HTML sou
-
Any suggestions of how to get an HP 1100A working with a Mac Mini? I've replaced my Dos machine (running XP) with a Mini and everything now works apart from the printer. Is there a driver for the 1100A? I think it's a parallel connection. Is there a
-
How to create a select query to compare a collection via jpa?
I'm new to jpa (java persistence) and its query language. If I've an entity named "Person" with a collection of Addresses (a one-to-manay relationahip), how do I create a Select query to get a person by using a collection of Addresses as its input pa
-
French special characters not displayed properly in discoverer 11g
Gurus We are upgrading to discoverer 11.1.1.3 I have found that French special characters (letters with accents) are not displayed properly in the discoverer tool menu. Example Sélectionner is displayed as S?lectionner. This doesn't seem to be a serv
-
Error messages from Enterprise Manager Grid control
Hi, Hi, I get several messages in my email daily from Enterprise Manager that Services from Application server control are down when all ther services are up and running. Messages like EM Alert: Critical: testdev - The OC4J instance is down. Any idea