Java 7.25 problems
Everytime I try to use a site to upload photos i get the error message "download java and install". I am using OS X 10.7.5 and Java 7 update 25. with Safari 6.0.5. It worked last week but not this week. have tried deleting cache and reinstalling Java 7 and quitting and restarting Safari but can't get any further than this error message. Java is enabled within Safari.
Managed to upload photos on a friend's Windows machine with IE and it worked okay.
If you use Safari there is a a pane in Safari preferences>security Plugins which allows you to select use Java.
In FireFox check into the manage add-ons for enabling Java.
Apple tends to disable Java as it is the path that most malware is launched.
You may have to re-enable Java when you need to use it, it is a good idea to disable it when not needed for saftey reasons, tis is why the Apple default is to turn it off.
I avoid it when ever possible.
Thanks and wish all the best to you,
Be safe
Similar Messages
-
sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.
sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
I want to pass along a couple of tips that will get you more and better response on this list.
1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
4) If you have a question first search the examples for something tha
t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
Trying to help,
Welcome to the forum!
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Re Java Stored Procedure Problem
Ben
There appear to be some problem with the forum. It doesn't want to show my response to your post with the subject "Java Stored Procedure Problem". See the answer to this thread for an example of how to do this...
Is there a SAX parser with PL/SQL??Ben
There appear to be some problem with the forum. It doesn't want to show my response to your post with the subject "Java Stored Procedure Problem". See the answer to this thread for an example of how to do this...
Is there a SAX parser with PL/SQL?? -
I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2
Permission Problems in RDBMS 8.1.6 and 8.1.7".
It will be accessible from Oracle Support's "Metalink" site.
"How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
Problem Description
Periodically an application running in the Enterprise Java Engine
(EJE) formerly known as the "Oracle 8i JVM", "the JSERVER component", or
the "Aurora JVM" will fail with a "java 2" permissions error having the
following format :
Note : Message shown below have been reformatted for easier readability.
java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception:
usually followed by a detailed error message similar to one of the following
messages :
Example # 1
java.security.AccessControlException: the Permission
(java.net.SocketPermission hostname resolve)
has not been granted by dbms_java.grant_permission to
SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
Example # 2
java.security.AccessControlException: the Permission
(java.util.PropertyPermission * read,write)
has not been granted by dbms_java.grant_permission to
SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
Example # 3
java.security.AccessControlException: the Permission
(java.io.FilePermission \matt1.gif read)
has not been granted by dbms_java.grant_permission to
SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
Explanation
The java 2 permission stated in line # 2 of each of the above "Examples"
has not been granted to the user specified in line 4 of the above "Examples".
Solution Description
The methodology to solve this issue is identical for all java 2 permissions
cases.
1) Format a call "dbms_java.grant_permission" procedure as described below.
2) Logon as SYS or SYSTEM
3) Issue the TWO commands shown below
4) Logoff as SYS or SYSTEM
5) Retry your application
For Example # 1
1) Logon as SYS or SYSTEM
2) Issue the following commands :
a) call dbms_java.grant_permission('SCOTT',
'java.net.SocketPermission',
'hostname',
'resolve');
b) commit;
Note: Commit is mandatory !!
3) Logoff as SYS or SYSTEM
4) Retry your application
For Example # 2
1) Logon as SYS or SYSTEM
2) Issue the following commands :
a) call dbms_java.grant_permission('SCOTT',
'java.util.PropertyPermission',
'read,write');
b) commit;
Note: Commit is mandatory !!
3) Logoff as SYS or SYSTEM
4) Retry your application
For Example # 3
1) Logon as SYS or SYSTEM
2) Issue the following commands :
a) call dbms_java.grant_permission('SCOTT',
'java.io.FilePermission',
'\matt1.gif',
'read');
b) commit;
Note: Commit is mandatory !!
3) Logoff as SYS or SYSTEM
4) Retry your application
References
For more details on java 2 permissions and security within the EJE, review
Chapter 5, in the Java Developer's Guide. entitled,
"Security For Oracle8i Java Applications"
The RDBMS 8.1.7 version can be found at :
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/index.htmHi, Don,
I solved the problem of security exception I mentioned at java procedure topic as following:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException
I tried to use your solution as following:
call dbms_java.grant_permission('SDE', 'java.net.SocketPermission', 'ORCL.COHPA.UCF.EDU','resolve');
but SQL*plus gave me a error message:
invalid collumn.
What's the problem?
However, I call a grant command as following:
SQL> grant JAVASYSPRIV to sde;
and then that exception is gone. What's the difference between dbms_java.grant_permission and grant command?
Thanks
Bing
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by don -- oracle support:
I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2
Permission Problems in RDBMS 8.1.6 and 8.1.7".
It will be accessible from Oracle Support's "Metalink" site.
"How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
Problem Description
<HR></BLOCKQUOTE>
null -
SSO java sample application problem
Hi all,
I am trying to run the SSO java sample application, but am experiencing a problem:
When I request the papp.jsp page I end up in an infinte loop, caught between papp.jsp and ssosignon.jsp.
An earlier thread in this forum discussed the same problem, guessing that the cookie handling was the problem. This thread recommended a particlar servlet , ShowCookie, for inspecting the cookies for the current session.
I have installed this cookie on the server, but don't see anything but one cookie, JSESSIONID.
At present I am running the jsp sample app on a Tomcat server, while Oracle 9iAS with sso and portal is running on another machine on the LAN.
The configuration of the SSO sample application is as follows:
Cut from SSOEnablerJspBean.java:
// Listener token for this partner application name
private static String m_listenerToken = "wmli007251:8080";
// Partner application session cookie name
private static String m_cookieName = "SSO_PAPP_JSP_ID";
// Partner application session domain
private static String m_cookieDomain = "wmli007251:8080/";
// Partner application session path scope
private static String m_cookiePath = "/";
// Host name of the database
private static String m_dbHostName = "wmsi001370";
// Port for database
private static String m_dbPort = "1521";
// Sehema name
private static String m_dbSchemaName = "testpartnerapp";
// Schema password
private static String m_dbSchemaPasswd = "testpartnerapp";
// Database SID name
private static String m_dbSID = "IASDB.WMDATA.DK";
// Requested URL (User requested page)
private static String m_requestUrl = "http://wmli007251:8080/testsso/papp.jsp";
// Cancel URL(Home page for this application which don't require authentication)
private static String m_cancelUrl = "http://wmli007251:8080/testsso/fejl.html";
Values specified in the Oracle Portal partner app administration page:
ID: 1326
Token: O87JOE971326
Encryption key: 67854625C8B9BE96
Logon-URL: http://wmsi001370:7777/pls/orasso/orasso.wwsso_app_admin.ls_login
single signoff-URL: http://wmsi001370:7777/pls/orasso/orasso.wwsso_app_admin.ls_logout
Name: testsso
Start-URL: http://wmli007251:8080/testsso/
Succes-URL: http://wmli007251:8080/testsso/ssosignon.jsp
Log off-URL: http://wmli007251:8080/testsso/papplogoff.jsp
Finally I have specified the cookie version to be v1.0 when running the regapp.sql script. Other parameters for this script are copied from the values specified above.
Unfortunately the discussion in the earlier thread did not go any further but to recognize the cookieproblem, so I am now looking for help to move further on from here.
Any ideas will be greatly appreciated!
/MadsPierre - When you work on the sample application, you should test the pages in a separate browser instance. Don't use the Run Page links from the Builder. The sample app has a different authentication scheme from that used in the development environment so it'll work better for you to use a separate development browser from the application testing browser. In the testing browser, to request the page you just modified, login to the application, then change the page ID in the URL. Then put some navigation controls into the application so you can run your page more easily by clicking links from other pages.
Scott -
Unable to Launch Integration Builder: Java Web Start problem
Hi,
I am unable to launch the integration builder. I am using JDK 1.4.2_05. The java Web Start gives the following error:
Unsigned application requesting unrestricted access to system
Unsigned resource: http://<XIHostName>:50000/rep/repository/aii_util_rb.jar
I have tried deleting the Java web start cache, and even reinstalling the JDK.
Can someone suggest a workaround this problem ?
thanks,
ManishThe Java Web Start cannot accept unsigned jars. If the jars are signed, it will ask in a dialog box if it should allow unrestricted access to this jar.
In my case, I upgraded XI SP0 to SP4, which included updating the Adapter Core, Adapter Framework, and the XI TOOLS to SP4.
On launching the Web start, it seemed that the jars were not getting signed. JWS cannot allow unsigned jars to the client.
These jars are maintained in:
\usr\sap\<SID>\SYS\global\xi\directory_server\javaws\directory
I am having problems with my XI upgrade to SP4, and it is probably not signing the jars.
Do you know why this may be happening ...
thanks,
Manish -
We have a problem with our Java Web Start Application regarding the TLS certificate revocation check:
The application is running on a server within a wide area network which is separated from the internet.
The application users have access to the WAN, and also access to the internet over some corporate proxy/firewall.
The user has to enter, for example "https://my-site.de/myapp/ma.jnlp" within a webbrowser or could also call "javaws https://my-site.de/myapp/ma.jnlp" to start the application client.
The webserver has a certificate from a trusted certificate authority. This certificate seems to be ok, the browser is even configured to perform OCSP status check.
The application files are signed with a certificate from another trusted certificate authority. This certificate seems also to be ok. Regarding this certificate there
are no problems with certificate revocation checks.
The problem is, while starting the application client there is a message box which tell us something like "the connection to this website ist not trustworthy",
"Website: https://my-site.de:80", and something about an invalid certificate, meaning the webserver certificate.
Obviously the jvm runtime, which is executed on the users workstation, tries to perform a revocation check for the webservers certificate, but this fails because
it cannot fetch the certificate under https://my-site.de:80.
The application will execute without further problems after that message but the users are very concerned about the "invalid" certificate, so here are my questions:
- Why is the application trying to get the webserver certificate over Port 80. Our application developers told me, there is no corresponding statement. Calling this address
has to fail while "https://my-site.de:443" or "https://my-site.de" would not have a problem.
- Is there a way to make the application go on without performing a tls revocation check? I mean, by adjusting the application sourcecode and not by configuring the users Java Control Panel.
While disabling the TLS Certificate Revocation check in the Java Control Panel, the Webstart Application executes without a warning message, but this is not a workable solution for
our users.
It would be great if someone can help me with a hint so i can send our developers into the right direction;-)
Many thanks!
This is a part from a java console output after calling "javaws -verbose https://my-site.de/myapp/"
(sorry for this is in german... and also my english above)
network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
security: OCSP Response: GOOD
network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
security: UNAUTHORIZED
security: Failing over to CRLs: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
network: Cacheeintrag gefunden [URL: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl, Version: null] prevalidated=false/0
cache: Adding MemoryCache entry: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl
cache: Resource http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl has expired.
network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
network: ResponseCode für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: 200
network: Codierung für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: null
network: Verbindung mit http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl trennen
CacheEntry[http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl]: updateAvailable=true,lastModified=Tue Mar 24 10:50:01 CET 2015,length=53241
network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird
network: Verbindung von socket://ldap.serverpass.telesec.de:389 mit Proxy=DIRECT wird hergestellt
security: Revocation Status Unknown
com.sun.deploy.security.RevocationChecker$StatusUnknownException: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
at com.sun.deploy.security.RevocationCheckHelper.checkRevocationStatus(Unknown Source)
at com.sun.deploy.security.X509TrustManagerDelegate.checkTrusted(Unknown Source)
at com.sun.deploy.security.X509Extended7DeployTrustManagerDelegate.checkServerTrusted(Unknown Source)
at com.sun.deploy.security.X509Extended7DeployTrustManager.checkServerTrusted(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.model.ResourceProvider.getResource(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory._buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException
at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source)
... 35 more
Caused by: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
... 36 more
security: Ungültiges Zertifikat vom HTTPS-Server
network: Cacheeintrag nicht gefunden [URL: https://my-site.de:80, Version: null]Add the JSF Jars to the WEB-INF/lib directory of the application. If still getting error add to the CLASSPATH variable in the startWebLogic script in the domain/bin directory.
-
Java Swing application problem in Windows vista
When we execute the Swing application in windows vista environment.
The look and feel of the swing components are displayed improperly.
Do we need to put any specific look and feel for windows vista environment or any specific hardware configuration is required to setup windows vista environment.
Please give some inputs to solve the problem.
We have tried with the following sample code to run in windows vista.
* Vista.java
* Created on December 5, 2006, 5:39 PM
public class Vista extends javax.swing.JFrame {
/** Creates new form Vista */
public Vista() {
initComponents();
pack();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jButton1 = new javax.swing.JButton();
jToggleButton1 = new javax.swing.JToggleButton();
jPanel1 = new javax.swing.JPanel();
jCheckBox1 = new javax.swing.JCheckBox();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jTextField1 = new javax.swing.JTextField();
getContentPane().setLayout(null);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("Button 1");
getContentPane().add(jButton1);
jButton1.setBounds(20, 20, 170, 30);
jToggleButton1.setText("Togle btn");
getContentPane().add(jToggleButton1);
jToggleButton1.setBounds(100, 80, 90, 20);
jPanel1.setLayout(null);
jCheckBox1.setText("jCheckBox1");
jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));
jPanel1.add(jCheckBox1);
jCheckBox1.setBounds(10, 40, 130, 13);
getContentPane().add(jPanel1);
jPanel1.setBounds(10, 150, 200, 130);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
getContentPane().add(jScrollPane1);
jScrollPane1.setBounds(210, 150, 164, 94);
jTextField1.setText("jTextField1");
getContentPane().add(jTextField1);
jTextField1.setBounds(240, 30, 140, 30);
pack();
}// </editor-fold>//GEN-END:initComponents
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Vista().setVisible(true);
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
private javax.swing.JToggleButton jToggleButton1;
// End of variables declaration//GEN-END:variables
}When we execute the Swing application in windows
vista environment.
The look and feel of the swing components are
displayed improperly.Improperly means what? You must be aware that Vista's native L&F certainly isn't supported yet. -
Java Threads compilation problem
Hi everyone,
I've having problems getting a simple thread program to compile, the programs says " ; " expected when there is already one present. I've gone through the program many times and still can't put my finger on whats going wrong. If someone could take a quick look and if possible tell me where I am going wrong.
Many Thanks
Its class ThreadA that will not compile
***code********************************************
public class ThreadA extends Thread
private int id;
public ThreadA(int i) (id = i);
public void run()
for (int i=0}; i < 10; i++);
try {sleep(1000};)catch (InterruptedException e)();
System.out.println("Output from Thread " + id);
import java.io.*;
public class TestThreads1
public static void main (String args [] )
Thread t1 = new ThreadA (1);
Thread t2 = new ThreadA (2);
Thread t3 = new ThreadA (3);
t1.start();
t2.start();
t3.start();
**code***********************************************************public class ThreadA extends Thread
private int id;
public ThreadA(int i) (id = i); // <-- problem
public void run()
for (int i=0}; i < 10; i++); // <-- two problems
try {sleep(1000};)catch (InterruptedException e)(); // <-- more problems
System.out.println("Output from Thread " + id);
} -
Java/Active Directory problem
I have a strange problem. We have an application that we login to through a website. The application requires Java 1.42_9 to run properly. These workstations came from Dell with java 1.50_6 preloaded which I removed infavor of the required 1,42_9. Everything works normally when a user logs into the the workstation (WinXP SP2) as the local adminstrator. The problem arises when a user logs into the machine with an Active Directory account. We trying to run the website to login to our application and all we get is the Red X in the upper left hand corner of the screen. There is nothing in the Java console, it seems like java does not even attempt to start. I am not sure what Active Directory has to do with this but as long as we log in as a local admin everything works great. If I load Java 1.50_6 back on the workstation it works but it takes over two minutes for Java to load which is unacceptable. I have also tried 1.50_7 but it too take too long to load.
Sorry for the long winded post, but Im hoping someone has suggestions on why logging into Active directory causes 1.42_9 to fail.Your problem is your use of these two combinations
constrains.setSearchScope(SearchControls.SUBTREE_SCOPE);
ctx.search("", "(objectclass=*)", constrains); Many LDAP servers, including Active Directory, do not permit subtree searches from the root. -
PL/SQL Procedure Calling Java Host Command Problem
This is my first post to this forum so I hope I have chosen the correct one for my problem. I have copied a java procedure to call Unix OS commands from within a PL/SQL procedure. This java works well for some OS commands (Eg ls -la) however it fails when I call others (eg env). Can anyone please give me some help or pointers?
The java is owned by sys and it looks like this
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ExecCmd" AS
//ExecCmd.java
import java.io.*;
import java.util.*;
//import java.util.ArrayList;
public class ExecCmd {
static public String[] runCommand(String cmd)
throws IOException {
// set up list to capture command output lines
ArrayList list = new ArrayList();
// start command running
System.out.println("OS Command is: "+cmd);
Process proc = Runtime.getRuntime().exec(cmd);
// get command's output stream and
// put a buffered reader input stream on it
InputStream istr = proc.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(istr));
// read output lines from command
String str;
while ((str = br.readLine()) != null)
list.add(str);
// wait for command to terminate
try {
proc.waitFor();
catch (InterruptedException e) {
System.err.println("process was interrupted");
// check its exit value
if (proc.exitValue() != 0)
System.err.println("exit value was non-zero: "+proc.exitValue());
// close stream
br.close();
// return list of strings to caller
return (String[])list.toArray(new String[0]);
public static void main(String args[]) throws IOException {
try {
// run a command
String outlist[] = runCommand(args[0]);
for (int i = 0; i < outlist.length; i++)
System.out.println(outlist);
catch (IOException e) {
System.err.println(e);
The PL/SQL looks like so:
CREATE or REPLACE PROCEDURE RunExecCmd(Command IN STRING) AS
LANGUAGE JAVA NAME 'ExecCmd.main(java.lang.String[])';
I have granted the following permissions to a user who wishes to run the code:
drop public synonym RunExecCmd
create public synonym RunExecCmd for RunExecCmd
grant execute on RunExecCmd to FRED
grant javasyspriv to FRED;
Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/bin/env','execute');
commit
Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/opt/oracle/live/9.0.1/dbs/*','read, write, execute');
commit
The following test harness has been used:
Set Serverout On size 1000000;
call dbms_java.set_output(1000000);
execute RunExecCmd('/bin/ls -la');
execute RunExecCmd('/bin/env');
The output is as follows:
SQL> Set Serverout On size 1000000;
SQL> call dbms_java.set_output(1000000);
Call completed.
SQL> execute RunExecCmd('/bin/ls -la');
OS Command is: /bin/ls -la
total 16522
drwxrwxr-x 2 ora9sys dba 1024 Oct 18 09:46 .
drwxrwxr-x 53 ora9sys dba 1024 Aug 13 09:09 ..
-rw-r--r-- 1 ora9sys dba 40 Sep 3 11:35 afiedt.buf
-rw-r--r-- 1 ora9sys dba 51 Sep 3 09:52 bern1.sql
PL/SQL procedure successfully completed.
SQL> execute RunExecCmd('/bin/env');
OS Command is: /bin/env
exit value was non-zero: 127
PL/SQL procedure successfully completed.
Both commands do work when called from the OS command line.
Any help or assistance would be really appreciated.
Regards,
Bernard.Kamal,
Thanks for that. I have tried to use getErrorStream and it does give me more info. It appears that some of the commands cannot be found. I suspected that this was the case but I am not sure about how this can be as they all appear to reside in the same directory with the same permissions.
What is more confusing is output like so:
SQL> Set Serverout On size 1000000;
SQL> call dbms_java.set_output(1000000);
Call completed.
SQL> execute RunExecCmd('/usr/bin/id');
OS Command is: /usr/bin/id
exit value was non-zero: 1
id: invalid user name: ""
PL/SQL procedure successfully completed.
SQL> execute RunExecCmd('/usr/bin/which id');
OS Command is: /usr/bin/which id
/usr/bin/id
PL/SQL procedure successfully completed.
Regards,
Bernard -
Web Service From Java class, serialization problem
Hi,
I want to create Web Service from Java class, I made java project, generated web service from it, create web service archive project and deployed it to WAS 6.40.
My class have 2 methods,
public int add(int a, int b);
public MyResponse doSomthing(MyRequest req);
I can succesfully call add method from Web Service Navigator, it works fine but when I call doSomthing methods I get the following error:
<b>
Deserializing fails. Nested message: XML Deserialization Error. Result class [com.mycomp.sap_tech.ws.MyRequest] does not have property [Amount] of type [java.lang.String]. It is required to load XML..
</b>
Any ideas how to resolve it?
P.S. MyRequest class is exposed throw VI, has default constractor and public getters and setters for all properties. It implements Serializable as well. Any guesses?
Thanks in advance,
Victor.Hi Bhavik, thanks for response.
as I already mentioned it implements Serializable, so it is not the problem.
Thanks Avi but it didn't helps iether
Victor -
Java.rmi.ServerException Problem
The exception that has occured is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Process00Impl_Stub
I have the interface, Client, Server and the Implementation java files
in the same machine.
11/29/2002 08:52p 282 Process00.class
11/29/2002 08:25p 221 Process00.java
11/29/2002 07:40p 215 Process00.java.bak
11/29/2002 08:56p 1,008 Process00Client.java
11/29/2002 08:55p 1,010 Process00Client.java.bak
11/29/2002 08:57p 451 Process00Impl.class
11/29/2002 08:57p 936 Process00Impl.java
11/29/2002 08:52p 934 Process00Impl.java.bak
11/29/2002 08:57p 2,153 Process00Impl_Skel.class
11/29/2002 08:57p 3,938 Process00Impl_Stub.class
11/29/2002 08:56p 995 Process00Server.class
11/29/2002 08:57p 645 Process00Server.java
11/29/2002 08:56p 643 Process00Server.java.bak
I also have the _Stub.class. I do not know why I get this error. If any
one have an idea, kindly share with me.
Thanks.Hi,
I had the same problem. In my machine, path was having jre1.1.7 before my jdk 1.4. So it was picking up from jre1.1.7.
Java was happy when I moved my jdk1.4 path to the beginning of the path variable.
Hope this helps you. -
i am using jdk1.6.0_02,apache tomcat 5.5.23 ,mysql integrated with redhat linux EE 4 and.mysql connector java 5.0.7.bin.jar.
look at the the following java program
import java.sql.*;
public class TestMysql
public static void main(String args[])
try
String driver = "com.mysql.jdbc.Driver";
Class.forName( driver );
String url = "jdbc:mysql://localhost/test";
DriverManager.getConnection( url, "root", "mysql" );
catch( Exception x )
{ x.printStackTrace();
i got the following exception
java.sql.SQLException: Access denied for user 'root'@'localhost.localdomain' (us *** password:
YES)
at com.mysql.jdbc.SQLError.createSQLException(java.lang.String, java.lang.Str ***, int)
(Unknown Source)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(int) (Unknown Source)
at com.mysql.jdbc.MysqlIO.checkErrorPacket() (Unknown Source)
at com.mysql.jdbc.MysqlIO.secureAuth411(com.mysql.jdbc.Buffer, int, java.lang .String,
java.lang.String, java.lang.String, boolean) (Unknown Source)
at com.mysql.jdbc.MysqlIO.doHandshake(java.lang.String, java.lang.String, jav a.lang.String)
(Unknown Source)
at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Prop erties,
java.lang.String, java.lang.String) (Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Pr operties)
(Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Propertie s)
(/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, j
ava.lang.String) (/usr/lib/libgcj.so.5.0.0)
at Connect.main(java.lang.String[]) (Unknown Source)
access denied problem. but the user name and password are correct. i can login to mysql by using
the same username and password.
but when connecting through java , i can't ? what is the problem?
can u help me.?
actually i am working in JSP. and when i got this problem, i created a small java program for testing.
here i am submitting the java program.friend please put your code inside
// your code goes here it will more readable and other can solve it better.
==================
and your problem tells that you must set access permission inside
mySQL server.
or try with creating new User with password.
EnJOY.
Ghanshyam
Edited by: Ghanshyam on Sep 28, 2007 4:13 PM -
Java Front-end problems with Windows 200 Pro
Hi,
I have some problem on my pc with java applications front-end. I have windows 2000 Professional and use java(TM) 2 SDK, Standard Edition Version 1.3.1
Using every java applications (also development environment as JBuilder 4 Professional and Together 4) I have always problems with front-end: the text is bad visualized everytime I use the scroolbar, menu items into a menu are bad visualized while I drag over of them the mouse and so on...
To try to solve this my problem I have just installed Service Pack 2 for Windows 2000 Pro but I have not had good results - I keep to have the usual problem.
I'm aware that it is difficult to reproduce and however if anyone has some idea to solve my problem I am opened to every suggestion.
Thanks in advancethe text says that what technolody that they are using its called "Off Screen Images" once i used them in my applications to improve the prefomance.
What they says is to improve the time it takes to display componants that display text on them (Such as buttons, Labels...) they going to create an Off Screen Image of the text and then paste that image on to the screen whenever the componant has to be displayed/Re displayed instead of redrowing (Re rendering) the text on the screen repeatedly which take more time and processing power than rendering once and paste it to screen whenever needed but this solution will take some more memory. -
Who can help me :)--a problem with java program(reset problem in java )
I do not know how to make the button reset,my program only could reset diagram but button.If any one who could help me to solve this problem.The problem is When the reset button is pressed, the image should immediately revert to the black square, and the 4 widgets listed above should show values that
correspond to the black square.The code like this,first one is shapes:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class shapes extends JFrame {
private JPanel buttonPanel; // panel for buttons
private DrawPanel myPanel; // panel for shapes
private JButton resetButton;
private JComboBox colorComboBox;
private JRadioButton circleButton, squareButton;
private ButtonGroup radioGroup;
private JCheckBox filledButton;
private JSlider sizeSlider;
private boolean isShow;
private int shape;
private boolean isFill=true;
private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
"green", "lightgray", "magenta", "orange",
"pink", "red", "white", "yellow"}; // color names list in ComboBox
private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
Color.gray, Color.green, Color.lightGray, Color.magenta,
Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
public shapes() {
super("Draw Shapes");
// creat custom drawing panel
myPanel = new DrawPanel(); // instantiate a DrawPanel object
myPanel.setBackground(Color.white);
// set up resetButton
// register an event handler for resetButton's ActionEvent
resetButton = new JButton ("reset");
resetButton.addActionListener(
// anonymous inner class to handle resetButton events
new ActionListener() {
// draw a black filled square shape after clicking resetButton
public void actionPerformed (ActionEvent event) {
// call DrawPanel method setShowStatus and pass an parameter
// to decide if show the shape
myPanel.setShowStatus(true);
isShow = myPanel.getShowStatus();
shape = DrawPanel.SQUARE;
// call DrawPanel method setShape to indicate shape to draw
myPanel.setShape(shape);
// call DrawPanel method setFill to indicate to draw a filled shape
myPanel.setFill(true);
// call DrawPanel method draw
myPanel.draw();
myPanel.setFill(true);
myPanel.setForeground(Color.black);
}// end anonymous inner class
);// end call to addActionListener
// set up colorComboBox
// register event handlers for colorComboBox's ItemEvent
colorComboBox = new JComboBox(colorNames);
colorComboBox.setMaximumRowCount(5);
colorComboBox.addItemListener(
// anonymous inner class to handle colorComboBox events
new ItemListener() {
// select shape's color
public void itemStateChanged(ItemEvent event) {
if(event.getStateChange() == ItemEvent.SELECTED)
// call DrawPanel method setForeground
// and pass an element value of colors array
myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
myPanel.draw();
}// end anonymous inner class
); // end call to addItemListener
// set up a pair of RadioButtons
// register an event handler for RadioButtons' ItemEvent
squareButton = new JRadioButton ("Square", true);
circleButton = new JRadioButton ("Circle", false);
radioGroup = new ButtonGroup();
radioGroup.add(squareButton);
radioGroup.add(circleButton);
squareButton.addItemListener(
// anonymous inner class to handle squareButton events
new ItemListener() {
public void itemStateChanged (ItemEvent event) {
if (isShow==true) {
shape = DrawPanel.SQUARE;
myPanel.setShape(shape);
myPanel.draw();
}// end anonymous inner class
);// end call to addItemListener
circleButton.addItemListener(
// anonymous inner class to handle circleButton events
new ItemListener() {
public void itemStateChanged (ItemEvent event) {
if (isShow==true) {
shape = DrawPanel.CIRCLE;
myPanel.setShape(shape);
myPanel.draw();
else
System.out.println("Please click Reset button first");
}// end anonymous inner class
);// end call to addItemListener
// set up filledButton
// register an event handler for filledButton's ItemEvent
filledButton = new JCheckBox("Filled", true);
filledButton.addItemListener(
// anonymous inner class to handle filledButton events
new ItemListener() {
public void itemStateChanged (ItemEvent event) {
if (isShow==true) {
if (event.getStateChange() == ItemEvent.SELECTED) {
isFill=true;
myPanel.setFill(isFill);
myPanel.draw();
else {
isFill=false;
myPanel.setFill(isFill);
myPanel.draw();
else
System.out.println("Please click Reset button first");
}// end anonymous inner class
);// end call to addItemListener
// set up sizeSlider
// register an event handler for sizeSlider's ChangeEvent
sizeSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 300, 100);
sizeSlider.setMajorTickSpacing(10);
sizeSlider.setPaintTicks(true);
sizeSlider.addChangeListener(
// anonymous inner class to handle sizeSlider events
new ChangeListener() {
public void stateChanged(ChangeEvent event) {
myPanel.setShapeSize(sizeSlider.getValue());
myPanel.draw();
}// end anonymous inner class
);// end call to addChangeListener
// set up panel containing buttons
buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
buttonPanel.add(resetButton);
buttonPanel.add(filledButton);
buttonPanel.add(colorComboBox);
JPanel radioButtonPanel = new JPanel();
radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
radioButtonPanel.add(squareButton);
radioButtonPanel.add(circleButton);
buttonPanel.add(radioButtonPanel);
// attach button panel & draw panel to content panel
Container container = getContentPane();
container.setLayout(new BorderLayout(10,10));
container.add(myPanel, BorderLayout.CENTER);
container.add(buttonPanel, BorderLayout.EAST);
container.add(sizeSlider, BorderLayout.SOUTH);
setSize(500, 400);
setVisible(true);
public static void main(String args[]) {
shapes application = new shapes();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}second one is drawpanel:
import java.awt.*;
import javax.swing.*;
public class DrawPanel extends JPanel {
public final static int CIRCLE = 1, SQUARE = 2;
private int shape;
private boolean fill;
private boolean showStatus;
private int shapeSize = 100;
private Color foreground;
// draw a specified shape
public void paintComponent (Graphics g){
super.paintComponent(g);
// find center
int x=(getSize().width-shapeSize)/2;
int y=(getSize().height-shapeSize)/2;
if (shape == CIRCLE) {
if (fill == true){
g.setColor(foreground);
g.fillOval(x, y, shapeSize, shapeSize);
else{
g.setColor(foreground);
g.drawOval(x, y, shapeSize, shapeSize);
else if (shape == SQUARE){
if (fill == true){
g.setColor(foreground);
g.fillRect(x, y, shapeSize, shapeSize);
else{
g.setColor(foreground);
g.drawRect(x, y, shapeSize, shapeSize);
// set showStatus value
public void setShowStatus (boolean s) {
showStatus = s;
// return showstatus value
public boolean getShowStatus () {
return showStatus;
// set fill value
public void setFill(boolean isFill) {
fill = isFill;
// set shape value
public void setShape(int shapeToDraw) {
shape = shapeToDraw;
// set shapeSize value
public void setShapeSize(int newShapeSize) {
shapeSize = newShapeSize;
// set foreground value
public void setForeground(Color newColor) {
foreground = newColor;
// repaint DrawPanel
public void draw (){
if(showStatus == true)
repaint();
}If any kind people who can help me.
many thanks to you!4 widgets???
maybe this is what you mean.
add this inside your actionPerformed method for the reset action
squareButton.setSelected(true);
colorComboBox.setSelectedIndex(0);
if not be more clear in your post.
Maybe you are looking for
-
Fund Managment - Availability Control
Hi! all experts, I have come across the following Fund Management problem : If there is NO budget data for a commitment item in this financial year, Purchase Order can be saved against that commitment item even thou Fund Checking has turned on. There
-
Hi.. I am doing Idoc to File scenario. In the receiver file structure, we have structure like below Header -- 1 Body -- 0 to n Trailer -- 1 In the file adapter, i have used append mode. So if we have triggered 3 idocs, we will get 3 files append
-
HELP MY EARPHONES DO NOT WANT TO WORK
I have had my blackberry Z10 for about a week now. Everything is perfect but today when i tried to put my earphones in (the one that came with the phone) it did not work. I hav used these same earphones in the device before and it has worked fine. Is
-
Can i change the current email adress with a different one and still keep my purchases?
can i change the current email adress with a different one and still keep my purchases?
-
Getting ora-7445 while initiating XMLDB in 11.2.0.3
Hi, all The db is installed on windows 2008R2. While running catqm in 11.2.0.3, I am getting the following error: ORA-07445: exception encountered: core dump [kkqvmdrv2()+1410] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x144CA460C] [UNABLE_TO_READ] [] The er