problem creating PJC

Please help:
goal: find the URL of the document in which the applet is embedded

Attempt: Applet class and Getdocumentbase() or GetCodeBase method used in the creation of JDeveloper PJC

Problem: Compilation error wrong method - a dynamic method can be used in static context

The code as follows
package oracle.forms.fd;
import java.net.InetAddress;
import java.io.InputStream;
import java.io.BufferedInputStream;
import java.io.IOException;
to import java.text.ParseException;
import java.util.StringTokenizer;
import java.applet.Applet;
Import oracle.forms.ui.VBean;
Import oracle.forms.handler.IHandler;
Import oracle.forms.properties.ID;


/ public final class AppletInfos extends kifani
{
………..
…………….
………..
private final static ID DIP = ID.registerProperty ("DIP");
private final static MAC ID is ID.registerProperty ("MAC");.
………………..
………………
private String some days in Paris ="";
private String sMAC = "";
Private boolean Arnaud = false;
public void init (Manager IHandler)
{
Super.init (Handler);
try {}
Some days in Paris = Applet.getCodeBase ();
sMAC = getMacAddress();
} catch (Throwable t) {}
t.printStackTrace ();
}
}
public Object getProperty (pId No.)
{
if(PID == GETINFOS)
{
sInfos += "\nMAC address:" + sMAC.
return of sInfos;
}
else if(pId == DIP) return some days in Paris;
else if(pId == MAC) return sMAC;
Return super.getProperty (pId);
}

Private final public static String getMacAddress() throws IOException {}
The os string = System.getProperty ("os.name");
try {}
{if (OS. StartsWith ("Windows"))}
Return windowsParseMacAddress (windowsRunIpConfigCommand ());
}
else {if (os.startsWith ("Linux"))
Return linuxParseMacAddress (linuxRunIfConfigCommand ());
}
else {}
throw new IOException ("unknown operating system:" + os);
}
} catch (ParseException ex exception) {}
ex.printStackTrace ();
throw new IOException (ex.getMessage ());
}
}
/*
* Linux stuff
*/
Private final public static String linuxParseMacAddress (String ipConfigResponse) throws ParseException {
String localHost = null;
try {}
localHost = InetAddress.getLocalHost () .getHostAddress ();
} catch (exception java.net.UnknownHostException ex) {}
ex.printStackTrace ();
throw new ParseException (ex.getMessage (), 0);
}
StringTokenizer tokenize = new StringTokenizer (ipConfigResponse, "\n");
String lastMacAddress = null;
{while (tokenizer.hasMoreTokens ())}
String line = tokenizer.nextToken (.trim ());
Boolean containsLocalHost = line.indexOf (localHost) > = 0;
If the line contains the IP address
If (containsLocalHost & & lastMacAddress! = null) {}
Return lastMacAddress;
}
If the line contains the MAC address
int macAddressPosition = line.indexOf ("HWaddr");
If (macAddressPosition < = 0) Then continues
String macAddressCandidate = line.substring (macAddressPosition + 6) .trim ();
{if (linuxIsMacAddress (macAddressCandidate))}
lastMacAddress = macAddressCandidate;
continue;
}
}
ParseException ex = new ParseException
("cannot read the MAC address for" + localHost + "from [" + ipConfigResponse + ""] ", 0");
ex.printStackTrace ();
throw ex;
}
{private static final boolean linuxIsMacAddress (String macAddressCandidate)
TODO: use a smart regular expression
If (macAddressCandidate.length ()! = 17) return false;
Returns true;
}
Private final public static String linuxRunIfConfigCommand() throws IOException {}
Process p is Runtime.getRuntime () .exec ("ifconfig");.
InputStream stdoutStream = new buffer (p.getInputStream ());
StringBuffer buffer = new StringBuffer();
for (;) {
int c = stdoutStream.read ();
If (c ==-1) break;
buffer. Append ((Char) c);
}
String outputText = buffer.toString ();

stdoutStream.close ();

return outputText;
}
/*
* Windows stuff
*/
Private final public static String windowsParseMacAddress (String ipConfigResponse) throws ParseException {
String localHost = null;
try {}
localHost = InetAddress.getLocalHost () .getHostAddress ();
} catch (exception java.net.UnknownHostException ex) {}
ex.printStackTrace ();
throw new ParseException (ex.getMessage (), 0);
}
StringTokenizer tokenize = new StringTokenizer (ipConfigResponse, "\n");
String lastMacAddress = null;

{while (tokenizer.hasMoreTokens ())}
String line = tokenizer.nextToken (.trim ());

If the line contains the IP address
If (Line.EndsWith (localHost) & & lastMacAddress! = null) {}
Return lastMacAddress;
}

If the line contains the MAC address
int macAddressPosition = line.indexOf(":");
If (macAddressPosition < = 0) Then continues

String macAddressCandidate = line.substring (macAddressPosition + 1) .trim ();
{if (windowsIsMacAddress (macAddressCandidate))}
lastMacAddress = macAddressCandidate;
continue;
}
}

ParseException ex = new ParseException ("can not read MAC addresses from [" + ipConfigResponse + "]", 0);
ex.printStackTrace ();
throw ex;
}
{private static final boolean windowsIsMacAddress (String macAddressCandidate)
TODO: use a smart regular expression
If (macAddressCandidate.length ()! = 17) return false;

Returns true;
}
Private final public static String windowsRunIpConfigCommand() throws IOException {}
Process p is Runtime.getRuntime () .exec ("ipconfig/all");.
InputStream stdoutStream = new buffer (p.getInputStream ());

StringBuffer buffer = new StringBuffer();
for (;) {
int c = stdoutStream.read ();
If (c ==-1) break;
buffer. Append ((Char) c);
}
String outputText = buffer.toString ();

stdoutStream.close ();

return outputText;
}
}

Hello

There are a number of errors in your code. Here's the corrected version that works:


package oracle.forms.fd;
import java.net.InetAddress;
import java.io.InputStream;
import java.io.BufferedInputStream;
import java.io.IOException;
to import java.text.ParseException;
import java.util.StringTokenizer;
import java.applet.Applet;
Import oracle.forms.ui.VBean;
Import oracle.forms.handler.IHandler;
Import oracle.forms.properties.ID;

/ public final class AppletInfos extends kifani
{

private final static ID DIP = ID.registerProperty ("DIP");
private final static MAC ID is ID.registerProperty ("MAC");.
private final static GETINFOS ID is ID.registerProperty ("GETINFOS");.

private String some days in Paris ="";
private String sMAC = "";
Private boolean Arnaud = false;
public void init (Manager IHandler)
{
Super.init (Handler);
try {}
Some days in Paris = handler.getApplet () .getCodeBase () .getHost ();
sMAC = getMacAddress();
} catch (Throwable t) {}
t.printStackTrace ();
}
}
public Object getProperty (pId No.)
{
if(PID == GETINFOS)
{
Return "\nMAC address:" + sMAC.

}
else if(pId == DIP) return some days in Paris;
else if(pId == MAC) return sMAC;
Return super.getProperty (pId);
}

Private final public static String getMacAddress() throws IOException {}
The os string = System.getProperty ("os.name");
try {}
{if (OS. StartsWith ("Windows"))}
Return windowsParseMacAddress (windowsRunIpConfigCommand ());
}
else {if (os.startsWith ("Linux"))
Return linuxParseMacAddress (linuxRunIfConfigCommand ());
}
else {}
throw new IOException ("unknown operating system:" + os);
}
} catch (ParseException ex exception) {}
ex.printStackTrace ();
throw new IOException (ex.getMessage ());
}
}
/*
* Linux stuff
*/


Private final public static String linuxParseMacAddress (String ipConfigResponse) throws ParseException {
String localHost = null;
try {}
localHost = InetAddress.getLocalHost () .getHostAddress ();
} catch (exception java.net.UnknownHostException ex) {}
ex.printStackTrace ();
throw new ParseException (ex.getMessage (), 0);
}
StringTokenizer tokenize = new StringTokenizer (ipConfigResponse, "\n");
String lastMacAddress = null;
{while (tokenizer.hasMoreTokens ())}
String line = tokenizer.nextToken (.trim ());
Boolean containsLocalHost = line.indexOf (localHost) > = 0;
If the line contains the IP address
If (containsLocalHost & lastMacAddress! = null) {}
Return lastMacAddress;
}
If the line contains the MAC address
int macAddressPosition = line.indexOf ("HWaddr");
If (macAddressPosition<= 0)="">
String macAddressCandidate = line.substring (macAddressPosition + 6) .trim ();
{if (linuxIsMacAddress (macAddressCandidate))}
lastMacAddress = macAddressCandidate;
continue;
}
}
ParseException ex = new ParseException
("cannot read the MAC address for ' + 'from' localHost, 0);
ex.printStackTrace ();
throw ex;
}
{private static final boolean linuxIsMacAddress (String macAddressCandidate)
TODO: use a smart regular expression
If (macAddressCandidate.length ()! = 17) return false;
Returns true;
}
Private final public static String linuxRunIfConfigCommand() throws IOException {}
Process p is Runtime.getRuntime () .exec ("ifconfig");.
InputStream stdoutStream = new buffer (p.getInputStream ());
StringBuffer buffer = new StringBuffer();
for (;) {
int c = stdoutStream.read ();
If (c ==-1) break;
buffer. Append ((Char) c);
}
String outputText = buffer.toString ();

stdoutStream.close ();

return outputText;
}
/*
* Windows stuff
*/
Private final public static String windowsParseMacAddress (String ipConfigResponse) throws ParseException {
String localHost = null;
try {}
localHost = InetAddress.getLocalHost () .getHostAddress ();
} catch (exception java.net.UnknownHostException ex) {}
ex.printStackTrace ();
throw new ParseException (ex.getMessage (), 0);
}
StringTokenizer tokenize = new StringTokenizer (ipConfigResponse, "\n");
String lastMacAddress = null;

{while (tokenizer.hasMoreTokens ())}
String line = tokenizer.nextToken (.trim ());

If the line contains the IP address
If (Line.EndsWith (localHost) & lastMacAddress! = null) {}
Return lastMacAddress;
}

If the line contains the MAC address
int macAddressPosition = line.indexOf(":");
If (macAddressPosition<= 0)="">

String macAddressCandidate = line.substring (macAddressPosition + 1) .trim ();
{if (windowsIsMacAddress (macAddressCandidate))}
lastMacAddress = macAddressCandidate;
continue;
}
}

ParseException ex = new ParseException ("cannot read the MAC address of", 0);
ex.printStackTrace ();
throw ex;
}
{private static final boolean windowsIsMacAddress (String macAddressCandidate)
TODO: use a smart regular expression
If (macAddressCandidate.length ()! = 17) return false;

Returns true;
}
Private final public static String windowsRunIpConfigCommand() throws IOException {}
Process p is Runtime.getRuntime () .exec ("ipconfig/all");.
InputStream stdoutStream = new buffer (p.getInputStream ());

StringBuffer buffer = new StringBuffer();
for (;) {
int c = stdoutStream.read ();
If (c ==-1) break;
buffer. Append ((Char) c);
}
String outputText = buffer.toString ();

stdoutStream.close ();

return outputText;
}
}

Make sure:

(1) refer to your bean (implementation class) as: oracle.forms.fd.AppletInfos
(2) use the get_custom_property built-in for your info:
For example:
: B1. MAC: = Get_Custom_Property (' B1.) TEXTAREA', 1, 'MAC');
: B1. DIP: = Get_Custom_Property (' B1.) TEXTAREA', 1, 'DIP');
Please note that there is a property GETINFOS that was not declared in your code and added. You can change it if you wish.
(3) you must sign your jar file. Check the webutil on your developer installation directory for an example.

Hafed
www.degenio.com

Published by: mhafod on January 24, 2009 23:26

If you want to see the changes that I made, please make a diff. Thank you.

Tags: Oracle Development

Similar Questions

  • 12.4.3.1 update volume problems created?

    12.4.3.1 update volume problems created?

    Hello

    I had no problem with the Volume in the latest version of iTunes. Can you give more details about the problem you are having?

    Jim

  • Problem creating ad hoc network-error: Windows could not set up the network.

    Original title: problem creating ad hoc network

    Hello dear,

    When I tried to set up an adhoc network and after entering the name and password of the network. Following up error message pop (Windows could not set up the network).

    I use windows 7.

    P.S. before I used to create the ad hoc network with no problems. But now no more.

    Kind regards

    Ana Paula Yousef

    Hello

     
    Did you change in the computer before this problem?
     
    I suggest to go through these steps and check.
     
     
    Method 2:
    Error message when you try to connect to an ad-hoc connection in Windows Vista or Windows 7: "Windows cannot connect to " http://support.microsoft.com/kb/946481 ".
     
    You can also check:
     
  • There was a problem creating the destination folder. If please check the permission of folder or choose a different folder.   What that means, tried to name several different folders, but still the same error message. Would be grateful for the help!

    There was a problem creating the destination folder. If please check the permission of folder or choose a different folder.   What that means, tried to name several different folders, but still the same error message. Would be grateful for the help!

    This means that the folder you want to create is blocked because of file permissions. The drive or folder you are trying to create the destination folder is set to read-only, and your username does not have write permissions.

  • Problem creating the destination for Lightroom 6 folder

    Just upgraded to Lightroon 6. Now I have a problem creating the destination folder. Already checked the folder permissions. Even tried a new folder nothing helps. A lot of space on the computer.

    Don't know who to turn to next. Is this a problem of individual computer?

    You must use a computer with permissions of administrator account

    Also, do a right click on the installer and select RUN AS ADMINISTRATOR from the popup option window to see if that helps

  • Problem creating hierarchy based on 2 physical dimension tables

    I'm having a problem create 1 dimension logic with a hierarchy of exploration, based on two separate physical dimension tables. The errors I get when navigating in the exploring hierarchy is:
    "Cannot find coverage source logical table to the columns of the logical" &
    "Missing join between the logical tables.

    I use OBIEE 10.1.3.4
    Here are the details of what I have set up as:

    Physical layer:
    Table DIM_ORG with the dimension columns:
    -dimension_key
    -org_total_code
    -org_total_description
    -org_detail_code
    -org_detail_description

    Dimension table DIM_DEPT with columns:
    -dimension_key
    -dept_total_code
    -dept_total_description
    -dept_detail_code
    -dept_detail_description

    FACT_SALES table with columns of facts:
    -fk_org
    -fk_dept
    -sum_sales

    Physical joins:
    FACT_SALES.fk_org = DIM_ORG_dimension_key
    FACT_SALES.fl_dept = DIM_DEPT.dimension_key

    Business model and the mapping of layer:
    I created a logical dimension ORG_DEPT. It contains two sources of logic table (DIM_ORG & DIM_DEPT) and the following logical columns:
    -All departments (mapped to dept_total_code)
    -Organization (mapped to org_detail_description)
    -Organisation number (mapped to org_detail_code)
    -Department (mapped to dept_detail_description)
    -Department Code (mapped to dept_detail_code)
    The logical key of the company is based on the combination of number of organization & Department Code

    The hierarchy, I need is: all departments-> organization-> Department so I created the following hierarchy for ORG_DEPT:
    -Total level containing: all departments
    -Organization level containing: company (defined as logical level key) number & Organisation (als defined the key level drill)
    / Department detail level containing: Department (defined as logical level key) Code and the Department (defined as key level drill).

    In the LTS of the ORG_DEPT dimension, I've set levels of content for sources:
    DIM_ORG: Level of organization
    DIM_DEPT: Level of detail Department
    The LTS non - joins inner - came against the associated physical tables.

    I created a logical fact table (based on the physical fact table) SALES and joined him on the ORG_DEPT logical dimension table.
    In the LTS, level of content for ORG_DEPT is part of the level of retail service. Non - joins inner were aded against related physical tables.

    When I create a report in response to test the hierarchy and select only "all departments' I get the value of the returned correct size. When I try to break through to the next level, I get the following ODBC error:
    "Could not find coverage source logical table for logical columns: [all of them]." "Please check more detailed level keys are correctly mapped.

    When I create a report in responses and select "Every department" and "Sales", I get the correct result. When I try to break through to the next level, I get a different ODBC error:
    "Lack of join between the logical tables DIM_DEPT and DIM_DEPT: there must be at least a physical link to join between the underlying physical tables.

    All suggestions are welcome!

    Thank you!

    You have no relationship defined between the Department and org.

    You can either:
    a. create a table of physical dimension with a composite key of org_id & dept_id if there is a relationship defined somewhere, then to obiee model as you have already done, but in the physical layer on the composite key join
    b. model your exisitng as two-dimensional and two hierarchies tables and set up a path of forest favorite between them according to your needs.

    Kind regards

    Robert

  • Problems creating a DB on ASM 11.2.0.1 10.2.0.4/11.1.0.7

    Hello

    I have some problems creating a DB 10.2.0.4/11.1.0.7 on top of ASM 11.2.0.1 using dbca. I can't get past step 7 when I select the DSO as a storage device.

    Here are the steps I did:

    -Install a 2 11.2.0.1 with ASM and Clusterware node RAC cluster, it worked well.
    -Set the 'Compatibility DB' 10.1.0.0.0 on in ASM disk groups.
    -Installed and configured a 11.2.0.1 database on this cluster, this has worked.
    -Installed software DB at separate Oracle 10.2.0.1.
    -Updated installation of 10.2 to 10.2.0.4.
    -Installed software DB at separate Oracle 11.1.0.6.
    -Updated installation of 11.1 to 11.1.0.7.

    Now, when I run dbca (it produced both of the O_H 10.2 and 11.1) in step 7 in the wizard I select "Select ASM as storage" and then when I press Next, I get this error message:

    "DBCA couldn't start the ASM instance is configured on this node. To proceed with the creation of the database using ASM, you need the ASM instance to be operational. You want to re-create the ASM instance on that node? "

    In the dbca log file I see "ASM present but is not activated, user mark..."

    What should I do to be able to create a DB 10.2 on 11.2 ASM? I also tried to put TNS_ADMIN to the directory of network/admin under the grid infrastructure, however, this does not work eitther, I still get the same problem.

    Any ideas what are the measures that I have to do in order to create a 10.2 / 11.1 DB on top of 11.2 Grid Infrastructure?

    Thank you

    It seems that the problem is related to the following bug:

    Bug.8288940 (74) TB - CMP 11106 DBCA TRY TO START 11.2 ASM WHICH IS ALREADY in PLACE AND REPORT FAILURE

    After applying the hotfix 8288940 at home 10 g DB, the creation of data base RAC succeeded.

    Hope this helps,

    Lisa Vance

  • Problem creating an event in Final cut Pro

    Hello

    I am running Final Cut Pro 10.2.3.

    I created a new library, but when I imported my videos, then in a folder called "smart Collections".

    This folder has never appeared before.

    When I tried to create a new event, the clips remained in smart Collections folder.

    I couldn't tell the program to duplicate clips in the new event.

    What is going on?

    I deleted the new library and started again.

    I deleted the new library, restart Final Cut Pro.

    The problem persisted.

    Help, please.

    Guy

    When you create a library, an event is created as well as smart collections featured med goes into the event and can also go in smart collections. You can't have a library without an event which takes place in the media. Maybe you can post a screenshot of what appears in your browser.

  • (BUG) Problem creating events of the calendar in the past (IOS 9.3.1)

    Recently, I get such a problem:

    1. I opened a last date in the calendar default ios

    2. create an event:

    -put the name of the event 'Accident '.

    -day 17 April 2016

    -start time 16:00 (end time 17:00)

    -all other attributes - default:

    calendar by default (have also 1 calendar personalized in a list)

    No rehearsal, no trigger time, no participating, call back in 30 minutes

    * a tried also the attributes of different event with the same effect. Didn't help not also choose my google calendar. tried several times)

    3. Press 'Add '.

    wait: event created, appears on that date and remains

    get: event appears and disappears in about 1 second

    What could be? Can help you with this? What IOS Bug?

    Creation of future events - no problem

    Settings - Mail, Contacts - synchronization scroll to calendars - events - How back does go - you may need to reset it to take account of the date that you set the old event from

  • Problem creating recover DVD - Equium L350

    Please help, I just bought a L350 laptop and cannot create a recovery DVD.
    The writing of the DVD begins, and after 10-15 minutes the fails and I get the following message:

    The following question ccured while recoding data on the disk. A power calibration area error.
    Please, check if the disc is scratched or dirty, if so, please try again with a new disc. (error code: 0e01b5-26-00037304)

    Hello

    You get the power calibration error?
    Well, this error appears if the disk s lens may not calibrate properly in place.
    Above all, it occurs due to a mechanical problem s drive and in most cases, the CD/DVD drive must be replaced.

    On the other hand, the goal could not calibrate correctly using not compatible and not support CDs or DVDs.

    Have you tried burning different media from different manufacturers?
    If this is not the case, try this!

    Good luck

  • Problem creating an account of HP Web Services

    Hi, I just brought a 4500 desire.  All the installation program has been very well and I can print and scan wireless so I'm sure the printer works.  I also activated the Web service and received a paper copy of the printer that lists the steps and the printer code.

    However, when I tried to create a new account on behalf of HP Web Services, after I entered all the required information, it still not let me go through and said "Email must match to ' and ' match of motorization of passwords '.»  So for the moment I'm not able to use eprint.

    I appreciate if anyone can help?

    I read another post with the same problem after I sent my.  I think that my problem was that IE and Chrome do not display the field "confirm your password" so that I can do it using Firefox.  If the account is created.

    Anyway, it is now resolved and thanks for your quick response.

    Thank you!

  • Problem creating drive recovery for Satellite L550-10N

    Hello.

    I just bought a L550-10N and the first thing I tried to do is to create recovery discs using the Toshiba recovery disc creator.

    Everything went well on the first creation of disc (4 must be created).
    The problem starts with the second disk: about when it's half burned, decisions of the gauge, the DVD drive continues to function for hours and never stops.

    I tried the process again, but it was exactly the same.

    Anyone an idea how to solve this problem?

    Thank you!

    According to my experience, the best thing you can do is to create a recovery media using DVD-R virgins.
    I have created for several different models of laptops using TDK or Verbatim DVD-R media, and every time everything was fine.

  • HP Officejet 4630: Problem creating account e-print

    Hello. I just bought the printer above a few days ago.  We realized the implementation on the printer itself without problems, but when you try to create the account e-print, either with the web link or CD-ROM, we were informed that there was a problem with the server and could not proceed.  We tried the link on both our netbook with windows 8.1 and that of our laptops with windows 7.  Is there a problem with the HP Server or if we have missed a step?  Any help would be appreciated.  Thank you.

    Hello

    Printer should work without connected HP account. Ony use my connected HP account when I answer setting up accounts. You can create today, next week, or the month following your printer still works without function ePrint. I don't know what stage you are now so I can't say. Have you installed software and the drivers from the CD that came with the printer to run the installation on your computer?

    Kind regards.

  • Problems creating "Restricted user" on Yoga 3

    Hi all

    I just bought two tablets 3 Yoga for children for Christmas, and I'm setting them up before I give them to them. I want their access to him be a bit limited, so I myself put in place as the user owner of the tablets, and then I'll give them limited accounts. Or is the plan. :-) I have improved the tablets of the latest version of the firmware, so I should have 5.1.1.

    I created a restricted account, with certain permissions, and then I switch to this user. But then, I get in a home screen entirely black. It's just the three soft keys at the bottom of the screen. Nothing happens when I press the triangle or circle, but if I press the spot, I get into what is usually the list of screens of course, but the list is empty. From there, I can start the Task Manager, but there is nothing on this list either. It is said that he uses however 433 MB of RAM.

    So, it's a little too restrictive, looks like the only thing that I can use restricted user mode is the camera. :-) Guess this isn't really the intention, and there is probably an easy fix, so how can I I fix?

    Best,

    Kjetil

    I found the solution to the problem myself, just display for future reference. Turns out that it was important the HPROF app was enabled... It's just weird, Lenovo should probably look into fixing that, but at least it's working now.

  • Problem creating bootable installation for El Capitan

    Hello

    When I try to create an installation program for El Capitan bootable on a new MacBook Pro (A1278) in November 2015 using the string SUDO included in

    HT201372: Create a bootable OS x Installer, I get an immediate failure with the answer "sudo: failed to initialize the PAM: no such file or directory." Diskmaker X loops on it and runs into the same answer of the problem.  Is there a solution or the solution to this problem?

    If you do not already have a current backup, please backup all data, and then reinstall the OS. * you don't need to erase the boot volume, and you won't need the backup unless something is wrong. If the system has been upgraded an earlier version of Mac OS X, you may need to the Apple ID and password to use.

    There are ways to back up a computer that is not fully functional. Ask if you need advice.

    If you installed the runtime Java distributed by Apple, and still need, you will need to reinstall it. It goes the same for Xcode. All other data will be preserved.

    Related support article refers to OS X 10.11 ("El Capitan"), but the procedure is the same for OS X 10.7 ("Lion") and later versions.

Maybe you are looking for