Applet thing

I've done an applet which runs perfectly on my PC. When I tried to run it on an other computer with JVM installed it only viewed gray nothingness in a browser's window. Is that JVM's difference? PC runs Java games with no problems (such as RuneScape).

Make sure the java plug-in is the same on both the working and non-working computer. go to
http://javatester.org/version.html
it will tell you the plug-in version your browser is using. make sure it's the same for both machines.

Similar Messages

  • Java Applet Constantly Asks for Authentication

    With have a ADF application on Weblogic 10 that has occasional access to a Java applet. The Java applet is loaded whenever it's needed and not loaded whenever it isn't in a facet. The applet is currently in the public_html/applet folder.
    When we set the SSL configuration to requiring a client certificate, when the Java applet loads, it'll constantly ask for a client certificate even though the user already presented the client when hitting the website:
    Request Authentication Identification required. Please select certificate to be used for authentication.
    This is annoying to users and the Java Applet doesn't need authentication. Is there any way we can disable the authentication or remove the prompt?
    Here's the embedded applet code:
    <applet height="1" width="1" code="applet.Applet.class"archive="/app/applet/SApplet.jar" /><param name="permissions" value="all-permissions"/></applet>
    Things I've already tried:
    1) Setting the Applet up on HTTP instead of HTTPS; I get a warning about mixed content and still get the authentication pop-up.
    2) Created a minimal applet that only types out "HELLO WORLD" in the console, still get the authentication pop-up
    Here's the console window:
    Java Plug-in 1.6.0_35
    Using JRE version 1.6.0_35-b10 Java HotSpot(TM) Client VM
    User home directory = C:\Users\mfan
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@1df073d
    basic: Plugin2ClassLoader.addURL parent called for https://192.168.130.99/app/applet/HelloWorld.jar
    network: Cache entry not found [url: https://192.168.130.99/app/applet/HelloWorld.jar, version: null]
    network: Connecting https://192.168.130.99/app/applet/HelloWorld.jar with proxy=DIRECT
    network: Connecting http://192.168.130.99:443/ with proxy=DIRECT
    security: Loading Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loaded Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loading SSL Root CA certificates from C:\Users\mfan\AppData\LocalLow\Sun\Java\Deployment\security\trusted.jssecacerts
    security: Loaded SSL Root CA certificates from C:\Users\mfan\AppData\LocalLow\Sun\Java\Deployment\security\trusted.jssecacerts
    security: Loading SSL Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loaded SSL Root CA certificates from C:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loading Deployment SSL certificates from C:\Users\mfan\AppData\LocalLow\Sun\Java\Deployment\security\trusted.jssecerts
    security: Loaded Deployment SSL certificates from C:\Users\mfan\AppData\LocalLow\Sun\Java\Deployment\security\trusted.jssecerts
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Loading certificates from Internet Explorer ROOT certificate store
    security: Loaded certificates from Internet Explorer ROOT certificate store
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment session certificate store
    security: Checking if SSL certificate is in Deployment permanent certificate store
    security: KeyUsage does not allow digital signatures
    (and here's where the prompt comes up).

    Actually, setting the archive to http://URL works fine. No more request authentications come up.

  • Import MyClass; ... not in 1.4?

    I ran across this problem today.
    I am using an external group of classes that are not packaged. Everything seemed to be fine in 1.3, but now I get error compiling with an import statement, and of course if I get rid of the import and just use it I get an error also.
    Also, it seems to be fine with my 1.3 compiled code (using 1.4 interpreter)...
    Is this some bonus feature I have yet to hear of?
    Also, is there a workaround for this, since I do not control the source?
    tia
    kevin

    oh please, and when you're puting lotsa Applets on one web page, then how do you expect intepretter to handle all those MyApplet's? it shouldn't be to hard with one MyApplet per package, but when you're having all those Applets in one ...
    hey, you cannot put many classes with same name into one package, nor in unnamed package.
    maybe this applet thing is badd excample, but have you not seen any other programmer have also HelloWorld.class, HelloW.class, Hello.class or HW.class?
    that's why production code should be in packages... snipets, ok, these may be as well in unanamed package.
    BTW: there are some tools available that help you automagically migrate class from one package to another.
    so if anyone has some set of classes that need to be moved into package, then looking for such tool might be well worth of effort.

  • Safari and Chrome causing OS X 10.6.7 to crash frequently (daily) on certain websites

    I'm having problems with Safari and Chrome causing my MacBook Pro to crash almost daily when visiting some websites (e.g. ABCNews.com).  It is happening more frequently after recent upgrade to 10.6.7, but has happened frequently since i bought this laptop.  Not sure if it's an applet thing or not.  Here's my problem details and system configuration output from the problem report:
    Interval Since Last Panic Report:  411938 sec
    Panics Since Last Report:          3
    Anonymous UUID:                    0E5C898A-B8EC-456E-AC10-7E68CF876088
    Tue Apr 26 17:12:27 2011
    panic(cpu 3 caller 0x2aab59): Kernel trap at 0x019db894, type 14=page fault, registers:
    CR0: 0x8001003b, CR2: 0x1cc23000, CR3: 0x00100000, CR4: 0x00000660
    EAX: 0x00000000, EBX: 0x0103fdfa, ECX: 0x1cc23000, EDX: 0x00000568
    CR2: 0x1cc23000, EBP: 0x01a4b838, ESI: 0x00007ff6, EDI: 0x1cc22530
    EFL: 0x00010287, EIP: 0x019db894, CS:  0x00000008, DS:  0x1cc20010
    Error code: 0x00000000
    Backtrace (CPU 3), Frame : Return Address (4 potential args on stack)
    0x1a4b648 : 0x21b510 (0x5d9514 0x1a4b67c 0x223978 0x0)
    0x1a4b698 : 0x2aab59 (0x59aeec 0x19db894 0xe 0x59b0b6)
    0x1a4b778 : 0x2a09b8 (0x1a4b790 0x1a4b8ac 0x1a4b838 0x19db894)
    0x1a4b788 : 0x19db894 (0xe 0x48 0x10 0x19d0010)
    0x1a4b838 : 0x19d8873 (0x1cc2251c 0x7f46793a 0xe 0x70cc)
    0x1a4b8f8 : 0x19d476c (0x1a4b94c 0x1a4b950 0x1a4b954 0x1a4b944)
    0x1a4b978 : 0x31fde0 (0x0 0xde23404 0x2 0x1a4b9dc)
    0x1a4b9f8 : 0x3358c1 (0xde23404 0x2 0x7f467900 0xdaec680)
    0x1a4ba28 : 0x3530ff (0xde23404 0x2 0x7f467900 0xdaec680)
    0x1a4bbc8 : 0x359f00 (0x7f467900 0x1 0x0 0x1a4bc14)
    0x1a4bc48 : 0x35b843 (0x1 0x0 0x0 0x0)
    0x1a4bd68 : 0x35f5e5 (0x1c41d2b8 0x1 0x4b6ed4 0x2a358d)
    0x1a4bd88 : 0x4b7e74 (0x1c41d040 0x0 0x0 0x0)
    0x1a4be48 : 0x49f29d (0x1c41d040 0x0 0x1a4bec4 0x0)
    0x1a4be78 : 0x49d345 (0xda37f80 0x1a4bec4 0x0 0x1a4bf54)
    0x1a4bf18 : 0x49dac1 (0x1a4bf54 0xda37f80 0x13f77400 0x1)
    0x1a4bf78 : 0x4f6075 (0xf7da2a0 0xd658208 0xedfeb64 0x0)
    0x1a4bfc8 : 0x2a144d (0xd658204 0x0 0x10 0xf930fc4)
          Kernel Extensions in backtrace (with dependencies):
             com.cisco.nke.ipsec(2.0.1)@0x19d2000->0x1a40fff
    BSD process name corresponding to current thread: Safari
    Mac OS version:
    10J869
    Kernel version:
    Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
    System model name: MacBookPro6,1 (Mac-F22589C8)
    System uptime in nanoseconds: 25547555689859
    unloaded kexts:
    com.apple.iokit.IOUSBMassStorageClass          2.6.5 (addr 0x1a79000, size 0x45056) - last unloaded 20964611105017
    loaded kexts:
    com.paragon-software.filesystems.ntfs          82
    com.Logitech.Control Center.HID Driver          3.3.0
    com.symantec.kext.SymAPComm          11.1.2f17
    com.cisco.nke.ipsec          2.0.1
    com.symantec.kext.ips          3.2f8
    com.symantec.kext.internetSecurity          1.3.2f5
    com.apple.driver.AppleHWSensor          1.9.3d0
    com.apple.filesystems.autofs          2.1.0
    com.apple.driver.AppleMikeyHIDDriver          1.2.0
    com.apple.driver.AGPM          100.12.19
    com.apple.driver.AppleHDA          1.9.9f12
    com.apple.driver.AppleMikeyDriver          1.9.9f12
    com.apple.driver.IOBluetoothSCOAudioDriver          2.4.0f1
    com.apple.driver.AudioAUUC          1.54
    com.apple.driver.AppleUpstreamUserClient          3.5.4
    com.apple.driver.AppleMCCSControl          1.0.17
    com.apple.driver.SMCMotionSensor          3.0.0d4
    com.apple.kext.AppleSMCLMU          1.5.0d3
    com.apple.Dont_Steal_Mac_OS_X          7.0.0
    com.apple.iokit.CHUDUtils          364
    com.apple.iokit.CHUDProf          366
    com.apple.driver.AudioIPCDriver          1.1.6
    com.apple.driver.ACPI_SMC_PlatformPlugin          4.5.0d5
    com.apple.GeForce          6.2.6
    com.apple.driver.AppleGraphicsControl          2.8.68
    com.apple.driver.AppleLPC          1.4.12
    com.apple.driver.AppleIntelHDGraphics          6.2.6
    com.apple.driver.AppleIntelHDGraphicsFB          6.2.6
    com.apple.driver.AppleUSBTCButtons          200.3.2
    com.apple.driver.AppleIRController          303.8
    com.apple.driver.AppleUSBTCKeyboard          200.3.2
    com.apple.iokit.SCSITaskUserClient          2.6.5
    com.apple.BootCache          31
    com.apple.AppleFSCompression.AppleFSCompressionTypeZlib          1.0.0d1
    com.apple.iokit.IOAHCIBlockStorage          1.6.3
    com.apple.driver.AppleUSBHub          4.1.7
    com.apple.driver.AirPortBrcm43224          427.36.9
    com.apple.iokit.AppleBCM5701Ethernet          2.3.9b6
    com.apple.driver.AppleEFINVRAM          1.4.0
    com.apple.driver.AppleSmartBatteryManager          160.0.0
    com.apple.driver.AppleFWOHCI          4.7.1
    com.apple.driver.AppleUSBEHCI          4.1.8
    com.apple.driver.AppleAHCIPort          2.1.5
    com.apple.driver.AppleACPIButtons          1.3.5
    com.apple.driver.AppleRTC          1.3.1
    com.apple.driver.AppleHPET          1.5
    com.apple.driver.AppleSMBIOS          1.6
    com.apple.driver.AppleACPIEC          1.3.5
    com.apple.driver.AppleAPIC          1.4
    com.apple.driver.AppleIntelCPUPowerManagementClient          105.13.0
    com.apple.security.sandbox          1
    com.apple.security.quarantine          0
    com.apple.nke.applicationfirewall          2.1.11
    com.apple.driver.AppleIntelCPUPowerManagement          105.13.0
    com.apple.driver.IOBluetoothHIDDriver          2.4.0f1 - last loaded 20852316721650
    com.apple.driver.DspFuncLib          1.9.9f12
    com.apple.driver.AppleProfileReadCounterAction          17
    com.apple.driver.AppleProfileTimestampAction          10
    com.apple.driver.AppleProfileThreadInfoAction          14
    com.apple.driver.AppleProfileRegisterStateAction          10
    com.apple.driver.AppleProfileKEventAction          10
    com.apple.driver.AppleProfileCallstackAction          20
    com.apple.driver.AppleSMBusController          1.0.8d0
    com.apple.iokit.IOFireWireIP          2.0.3
    com.apple.iokit.IOSurface          74.2
    com.apple.iokit.IOBluetoothSerialManager          2.4.0f1
    com.apple.iokit.IOSerialFamily          10.0.3
    com.apple.iokit.CHUDKernLib          365
    com.apple.iokit.IOAudioFamily          1.8.0fc1
    com.apple.kext.OSvKernDSPLib          1.3
    com.apple.driver.AppleHDAController          1.9.9f12
    com.apple.iokit.IOHDAFamily          1.9.9f12
    com.apple.iokit.AppleProfileFamily          41.4
    com.apple.driver.AppleSMC          3.1.0d3
    com.apple.driver.IOPlatformPluginFamily          4.5.0d5
    com.apple.driver.AppleSMBusPCI          1.0.8d0
    com.apple.nvidia.nv50hal          6.2.6
    com.apple.NVDAResman          6.2.6
    com.apple.iokit.IONDRVSupport          2.2
    com.apple.iokit.IOGraphicsFamily          2.2
    com.apple.driver.BroadcomUSBBluetoothHCIController          2.4.0f1
    com.apple.driver.AppleUSBBluetoothHCIController          2.4.0f1
    com.apple.iokit.IOBluetoothFamily          2.4.0f1
    com.apple.driver.AppleUSBMultitouch          206.6
    com.apple.iokit.IOUSBHIDDriver          4.1.5
    com.apple.driver.AppleUSBMergeNub          4.1.8
    com.apple.driver.AppleUSBComposite          3.9.0
    com.apple.iokit.IOSCSIMultimediaCommandsDevice          2.6.5
    com.apple.iokit.IOBDStorageFamily          1.6
    com.apple.iokit.IODVDStorageFamily          1.6
    com.apple.iokit.IOCDStorageFamily          1.6
    com.apple.driver.XsanFilter          402.1
    com.apple.iokit.IOAHCISerialATAPI          1.2.5
    com.apple.iokit.IOSCSIArchitectureModelFamily          2.6.5
    com.apple.iokit.IOUSBUserClient          4.1.5
    com.apple.iokit.IO80211Family          314.1.1
    com.apple.iokit.IONetworkingFamily          1.10
    com.apple.iokit.IOFireWireFamily          4.2.6
    com.apple.iokit.IOUSBFamily          4.1.8
    com.apple.iokit.IOAHCIFamily          2.0.4
    com.apple.driver.AppleEFIRuntime          1.4.0
    com.apple.iokit.IOHIDFamily          1.6.5
    com.apple.iokit.IOSMBusFamily          1.1
    com.apple.kext.AppleMatch          1.0.0d1
    com.apple.security.TMSafetyNet          6
    com.apple.driver.DiskImages          289
    com.apple.iokit.IOStorageFamily          1.6.2
    com.apple.driver.AppleACPIPlatform          1.3.5
    com.apple.iokit.IOPCIFamily          2.6
    com.apple.iokit.IOACPIFamily          1.3.0
    Model: MacBookPro6,1, BootROM MBP61.0057.B0C, 2 processors, Intel Core i7, 2.66 GHz, 8 GB, SMC 1.57f17
    Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
    Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.10.131.36.9)
    Bluetooth: Version 2.4.0f1, 2 service, 19 devices, 1 incoming serial ports
    Serial ATA Device: APPLE SSD TS128B, 113 GB
    Serial ATA Device: MATSHITADVD-R   UJ-898
    USB Device: Hub, 0x0424  (SMSC), 0x2514, 0xfd100000
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0xfd120000
    USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8507, 0xfd110000
    USB Device: Hub, 0x0424  (SMSC), 0x2514, 0xfa100000
    USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0236, 0xfa120000
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x8218, 0xfa113000

    I think a similar thing is happening to me on my 2011 MBAir running the latest updates on Yosemite (10.10.1).
    First noticed issues on Chrome with websites like FB, Google Docs, some Apple support pages, Gmail, and other random sites. Chrome would show me the "Aw snap" page. Then tried resolving in Chrome by uninstalling extensions and creating a new profile with no luck. Then when I tested it on Safari, similar websites were crashing, except Safari threw up an error log immediately that looks a lot like the one above. The copied and pasted message is at the end of this post.
    Then when I was editing a movie on iMovie, it started freezing up with no error messages or warning whenever I tried to edit a title manually.
    It seems like a hardware issue, so I rebooted the Mac holding down D (I think) in order to get the hardware checker. Did that, no issues. Also tried repairing permissions.
    If I'm seeing a pattern, I'd say that it was crashing on more complex websites like FB and Google Docs. Many other sites work fine, like this page I'm writing this post in, Google searches, etc.
    I'm absolutely stumped on this one. The next thing I try will be to reinstall OS X, but I won't be able to do that for a while because it takes about 12 hours on my internet connection...
    Any ideas??
    Process:               com.apple.WebKit.WebContent [459]
    Path:                  /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.We bKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
    Identifier:            com.apple.WebKit.WebContent
    Version:               10600 (10600.1.25)
    Build Info:            WebKit2-7600001025000000~1
    Code Type:             X86-64 (Native)
    Parent Process:        ??? [1]
    Responsible:           Safari [445]
    User ID:               501
    Date/Time:             2014-11-19 12:57:05.477 -1000
    OS Version:            Mac OS X 10.10.1 (14B25)
    Report Version:        11
    Anonymous UUID:        2AF4D066-D406-789E-AF11-7910EE8B255B
    Time Awake Since Boot: 170 seconds
    Crashed Thread:        0  Dispatch queue: com.apple.main-thread
    Exception Type:        EXC_BAD_ACCESS (SIGBUS)
    Exception Codes:       0x000000000000000a, 0x0000000113dbbbee
    VM Regions Near 0x113dbbbee:
        mapped file            0000000113ceb000-0000000113d92000 [  668K] r--/rwx SM=COW  /Library/Fonts/Tahoma.ttf
    --> mapped file            0000000113d92000-0000000113dc1000 [  188K] r--/rwx SM=COW  /Library/Fonts/Microsoft/Verdana.ttf
        JS JIT generated code  000059fbc2800000-000059fbc2801000 [    4K] ---/rwx SM=NUL 
    Application Specific Information:
    Bundle controller class:
    BrowserBundleController
    Process Model:
    Multiple Web Processes
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libFontParser.dylib           0x00007fff8a8eaf65 TnameTable::FindName(unsigned short, unsigned short, unsigned short, unsigned short) const + 81
    1   libFontParser.dylib           0x00007fff8a8eadea TnameTable::GetPostscriptName() const + 64
    2   libFontParser.dylib           0x00007fff8a8eaba3 TSFNTFont::GetPostscriptName() const + 35
    3   libFontParser.dylib           0x00007fff8a8eaa69 TArrayOfFontsWithUniquePostscriptNames::Append(TFont* const&) + 65
    4   libFontParser.dylib           0x00007fff8a8e8983 TFont::CreateFontEntitiesForFile(char const*, bool, TSimpleArray<TFont*>&, bool, short, char const*) + 3181
    5   libFontParser.dylib           0x00007fff8a8e7783 FPFontCreateFontsWithPath + 210
    6   libCGXType.A.dylib             0x00007fff85c25931 create_private_data_with_path + 19
    7   com.apple.CoreGraphics         0x00007fff8764be8f CGFontCreateFontsWithPath + 40
    8   com.apple.CoreGraphics         0x00007fff8764ba95 CGFontCreateFontsWithURL + 377
    9   com.apple.CoreText             0x00007fff897b5b8f CreateFontWithFontURL(__CFURL const*, bool) + 69
    10  com.apple.CoreText             0x00007fff897b5a9d TCGFontCache::CopyFont(__CFURL const*, bool) const + 85
    11  com.apple.CoreText             0x00007fff897b58d4 TBaseFont::CopyNativeFont() const + 86
    12  com.apple.CoreText             0x00007fff897b5844 TBaseFont::CopyGraphicsFont() const + 26
    13  com.apple.CoreText             0x00007fff897c9f1b CTFontCopyGraphicsFont + 97
    14  com.apple.WebCore             0x00007fff91cbd67e WebCore::FontPlatformData::FontPlatformData(NSFont*, float, bool, bool, bool, WebCore::FontOrientation, WebCore::FontWidthVariant) + 110
    15  com.apple.WebCore             0x00007fff91dbc412 WebCore::FontCache::createFontPlatformData(WebCore::FontDescription const&, ***::AtomicString const&) + 434

  • Need help from people who know Java. Some beginner questions.

    Hello all.
    I just recently became interested in programming and I chose Java to learn (not really sure why), I am not really interested in the whole Java Applets thing because i can already do the same things in Flash. What I really want to do is to be able to make a program that can actually complete a task; for instance Is it hard/possible to fabricate a program that could say... do a simple task like open my browser, copy a file, move something ect. What type of file would it be? Would it be a standalone program or .class for MS-DOS? Also (I'v been doing examples and lessons) why are these done in my command prompt and not just executed as the program (.java?) they are (written in notepad). What is my java program export file called that can be used by others with java enviornment. I will finish an excersize and it will say congrats you've just made you first program, but if its a program then why am i running it in command prompt unlike a program i have like Adobe Photoshop where i click the icon and it opens. Is there a better language for me?
    These questions may sound stupid but i'v scrutinized the internet and found very little on these topics.
    Any help to any question would be greatly appreciated!
    Thanks alot,
    Tim

    Hello all.
    I just recently became interested in programming and
    I chose Java to learn (not really sure why), I am notYou should have sound reasons to pick a language...
    really interested in the whole Java Applets thing
    because i can already do the same things in Flash.
    What I really want to do is to be able to make a
    program that can actually complete a task; for
    instance Is it hard/possible to fabricate a program
    that could say... do a simple task like open my
    browser, copy a file, move something ect. What type
    of file would it be? Would it be a standalone program
    or .class for MS-DOS? All java files are compiled to bytecode, which are your .class files. Anyone wanting to use your bytecode will have to have the JRE installed...
    Also (I'v been doing examples
    and lessons) why are these done in my command prompt
    and not just executed as the program (.java?) they
    are (written in notepad). What is my java program
    export file called that can be used by others with
    java enviornment. See the previous answer...
    I will finish an excersize and it
    will say congrats you've just made you first program,
    but if its a program then why am i running it in
    command prompt unlike a program i have like Adobe
    Photoshop where i click the icon and it opens. Is
    there a better language for me?Thats because it starts you out with the language basics. Almost all languages start with the historic command shell programming.
    If you want to write a GUI, then you will have to use AWT, Swing, and or SWT....
    There are several advanced concepts you will have to master before you can write effective GUI's..
    If your looking for an easy way out, learn VB. You will need M$'s IDE to compile though.. Or VBA from within your favorite Windows APP... Many support VBA like the Office Suite, Autocad, and Open Office, and many more..
    These questions may sound stupid but i'v scrutinized
    the internet and found very little on these topics.
    Any help to any question would be greatly
    appreciated!
    Thanks alot,
    TimHave fun Tim...

  • Jpeg Encoding Problem

    Hello,
    I have an applet that reads a data file and plots a graph. Now i'm having problem converting the graph into a jpg file using a jpeg encoder.
    I have the following snippet of code in the end.
    File file = new File("c:\\vj\\graph.jpg");
         if (file.exists()) {file.delete();}
         try {file.createNewFile();} catch (IOException eIo) {}
         try
         OutputStream out = new FileOutputStream( file );
         Image image = (Image)chart2D.createImage(chart2D.getWidth() ,chart2D.getHeight());
         Graphics g = image.getGraphics();
         chart2D.paint(g);
         BufferedImage bufImage = (BufferedImage)image;
    //     JPEGEncodeParam jep = new JPEGEncodeParam();
         JPEGImageEncoder jencoder = JPEGCodec.createJPEGEncoder(out);
         jencoder.encode(bufImage);
         out.flush();
         out.close();
         } catch (IOException e) {}
    But when i run the applet it gives me a security exception saying:
    java.security.AccessControlException: access denied (java.io.FilePermission c:\vj\graph.jpg read)
    How do i fix this problem??
    Any help would be appreciated,
    Thanks,
    Mamtha.

    Unfortunately, you can't do file I/O from an applet unless it is a signed applet. See applet security FAQ:
    http://java.sun.com/sfaq/
    If it's at all feasible, by far the simplest solution is to add a min method and make it an application instead of an applet. If it must be an applet, things get a little more complicated! Here are a couple of possibilities:
    1) You could sign your applet. For an example, see:
    http://java.sun.com/security/signExample/
    2) You can send the file to the server where the applet came from, and then have the server write it to disk. Finally, the client can request the file from the server. For an explanation and example code, see:
    http://java.sun.com/docs/books/tutorial/applet/practical/workaround.html

  • Cineform raw footage samples - cs3 is ok

    hiya....found this interesting stuff...if anyone wants to check it out...
    http://www.siliconimaging.com/DigitalCinema/gallery_footage.html
    some hd sample footage from si 2k ...
    seem to be nice people at this place...mini is about $22,000 but email them and get up to 30 % discount for both mini and cinedeck ( $14,000 ).... those prices dont reflect discount... begin a conversation with them.
    this neo player ( see text below....) did install the codecs for me to put the cineform raw files into cs3 and also to "play" the files on my computer using classic media player
    I took the cineform applet thing out of my windows "startup" after installation ( and unchecked before removal, the "check for updates thing" )
    the si 2k gallery site...with some sample footage ( some compressed for viewing only , some raw from camera with look files )
    this excerpt below is in read me file in gallery page ( with raw samples )
    If you simply want to
    playback the files and import into AE and Premiere Pro, download NEO Player,
    which is a decoder-only product. NEO player will never expire unlike the 15-day
    demos of Prospect and NEO 2K.
    ps...the "throwing paper airplane " thing looks nice on my cs3 after levels adj...

    good going.... I have to admit I like that they (cineform) teamed up with that SI 2K thing for the cineform raw format...theres some cool stuff inherent with that ( automatic half res playback on slower systems ? think I read that.... )...the looks from kodak, etc....but that stuff is already years ago....we are on crest of tech wave.
    im gonna start new job soon with people who might help me find something 2nd hand that is affordable... or at least put my name out there for general gossip....so when someone wants to upgrade I can get same deal as B&H for "buy" price...  about half of what they sell it for later....
    in other words...im still mulling over your info ( camera you got and one you considered ), Jessica's info ( what she has now, etc )...and the full chip 35mm slr stuff available ( d5,d7 etc ).
    cant buy pro camera...ever....must rent that if I ever need it.  Just too much to chew on for shooting myself.  need ac to pull focus etc...no way thats ever gonna happen...the cost of lenses and accesories.
    gotta get computer too ( with camera ) and Im now leaning to HD ( as you suggested ).  SD sucks.
    I kinda like the SI 2k mini and cinedeck combo but its still way up there ( $$) even with 30% discount offered.  ( 22k + 14k ) at 30% off..but they are very cool people...and there are places to rent that ( hd camera in LA for example)....
    so ...no...Im still poor person with great aspirations and wanting to shoot and edit and have no camera.....
    however, I AM buying a bike tomorrow for the purpose of getting into shape....so maybe I will live long enough to actually DO something besides drink beer when Im not working !!!!!

  • Applet (Loading things ony once)

    Is there a way to only load things that you want once with an Applet. I only want the buttons and the background to load one time and then I want paint to just move an airplane across the screen (on top of the bg). Here is the code I'm using. When I comment out the firstTime flag it works (but it flickers)
    private boolean firstTime = true;
    public void paint(Graphics g)
      if (firstTime)
       doStuff(g);
       firstTime = false;
      g.drawImage(airplane, xPos, 0, 150, 100, this);
      xPos += 10;
      repaint(); 
    // I want this executed once. Possible?
    public void doStuff(Graphics g)
      // Get the width and height of the applet.  
      int width = getWidth();
      int height = getHeight();  
      // Set the 'level' buttons to the lower left hand corner
      // of the scren.
      easy.setBounds(0,height-20,40,20);
      medium.setBounds(50, height-20, 50, 20);
      hard.setBounds(110, height-20, 50,20);
      // Draw the background image.
      g.drawImage(bg1, 0, 0, width, height, this);
      firstTime = false; 
    }

    i did, but the problem was that i couldn't draw the image because i didn't have a Graphics object. When I created a graphics object it still didn't draw it.

  • Different things on Applets and Servlets

    I use Eclipse. I create two projects: applet and servlet (deploy on Tomcat). One is with the function main, the other has doGet. In these functions I write the same string:
    Mac.getInstance("HmacSHA1");
    But when I run applet - it's ok, when I deploy servlet and run on Tomcat - there are exception: java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
    How to make it availible at servlet?
    Message was edited by:
    AntonVatchenko

    The 2 apps (applet versus servlet) are likely using different versions of the Java runtime (and / or security extensions to them). And on one version that security algorithm exists (is built-in, or added as an extension in your JRE's lib/ext folder or something like that); while on the other the algorithm does not exist.
    Make the J2EE container (the one running the servlet) use the same version of Java as the applet is. I suppose that's just a hint though, that your next question will be something like "Ok, how do I do that?". My job was just to point you in the right direction. Hopefully I've done that.

  • Class not found. Or: THERE'S NO SUCH THING AS APPLETS

    Okay, the problem I�m having seems to be somewhat widespread judging from the forum achieves, but I wasn�t able to find any answers that worked for me. So forgive me if I�m treading old ground, but asking explicitly is my one last attempt to learn what�s going on.
    The problem is the �load: class <someclass.class> not found� gray screen whenever I try to view an applet. Now, looking around online, there are a few applets that I�ve been able to access, and many I haven�t; I�m not certain what causes some to work fine and others to gray screen, but there doesn�t seem to be a pattern to it other than the fact that if I can or can�t view one applet at a site, the same is generally true for all the other applets there as well.
    Now, as for local applets on my computer, I can�t view any of them. Not examples that come with the SDK, none that I�ve compiled myself, and none that I�ve downloaded. Needless to say, in my exasperation I�ve run through every possible permutation of html code for class and classpath and so on trying to modify code into working, but to no avail.
    Now, in the appletviewer, and in an IDE called RealJ, I can run applets just fine. It�s just those embedded in web pages that seem to give me trouble.
    I�ve uninstalled and reinstalled j2sdk 1.4.1. I�m running IE 6.0. Windows 98SE. In my Internet options, I have under Java (Sun) the �Use Java 2 v1.4.1 for applet� box checked, and under Java VM the �Java console enabled� and �JIT Compiler� boxes checked, though I have also gone through every permutation possible here, again, to no avail.
    Any idea what I can change so that I can start running applets with ease?
    Thanks in advance, I desperately appreciate whatever suggestions you can give.
    Travis

    gray screen whenever I try to view an applet.
    Now, looking around online, there are a few applets
    that I�ve been able to access, and many I haven�t; Basically it is partly your browser and partly the version of the jdk /sdk that you are viewing. Generally, IE does not support swing ie JApplet, JButton, JTextArea etc... which is a shame cos it has some pretty neat features - I particularly like the flexibility with textfields and textAreas - and my favourite: imageIcon, allows you to have the sexiest looking buttons in the known universe. For reasons like this, people who like to write Applets like to use swing ... and people who like Sun don't like windoze and IE and the like (and they definitely hate each other). So, if you change your browser to Netscape or Opera - you will see swinging applets galore.
    Shame really on a practical level, as the last survey I saw gave IE a 85 - 90 % share of the browser market. A bigger shame, when it seems to be deliberate that m-$oft do not include the latest JVM in their browser, yet they have the latest Flash plug-in. Both are in fact a good idea.
    Any idea what I can change so that I can start running
    applets with ease? Don't use swing and get a copy of something like jdk1.1.5 or even 1.1.2, if it compiles OK with this then it should be OK, keep it simple - as applets download on the client-side and can be unreliable and erratic so try and avoid images. Generally though Applets are a little bit out of vogue at the moment.

  • Is there any thing called applet loading timeout

    Friends...
    Is there anything known as applet loading timeout....
    One of my applets is geting loaded on intranet 1 which is faster but is not being loading on intranet 2 (a bit slower) keeping everything else same....
    please guide...
    what could be the reason...
    regards
    raghav..

    yes there are no exceptions until it says class not found exception..
    and yes of course they are into a jar file.
    raghav

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

  • Unable to delete applet.....

    Hi all,
    I am unable to delete one applet which I have loaded in the card.
    There are 2 applets, one is purse and other is loyalty. And am using shareable interface in which loyalty is the server and purse is the client. I can delete the purse applet but i can't delete the loyalty from the card.
    Here is my code : There are in all 3 codes, one is purse, second is loyalty code and third is the shareable interface code. Can some one look at the code and tell me what's wrong in this programs.
    package com.gemplus.examples.loyalty;
    import javacard.framework.*;
    import visa.openplatform.*;
    public class Loyalty extends javacard.framework.Applet implements TestInterface
    static byte points ;
    protected Loyalty(byte[] buffer, short offset, byte length)
    // data offset is used for application specific parameter.
    // initialization with default offset (AID offset).
    short dataOffset = offset;
    if(length > 9) {
    // Install parameter detail. Compliant with OP 2.0.1.
    // | size | content
    // |------|---------------------------
    // | 1 | [AID_Length]
    // | 5-16 | [AID_Bytes]
    // | 1 | [Privilege_Length]
    // | 1-n | [Privilege_Bytes] (normally 1Byte)
    // | 1 | [Application_Proprietary_Length]
    // | 0-m | [Application_Proprietary_Bytes]
    // shift to privilege offset
    dataOffset += (short)(1 + buffer[offset]);
    // finally shift to Application specific offset
    dataOffset += (short)(1 + buffer[dataOffset]);
    // checks wrong data length
    if(buffer[dataOffset] != 4)
    // return received proprietary data length in the reason
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + offset + length - dataOffset));
    // go to proprietary data
    dataOffset++;
    // points = 0;
    // register this instance
    register(buffer, (short)(offset + 1), (byte)buffer[offset]);
    * Method installing the applet.
    * @param bArray the array constaining installation parameters
    * @param bOffset the starting offset in bArray
    * @param bLength the length in bytes of the data parameter in bArray
    public static void install(byte[] bArray, short bOffset, byte bLength) throws ISOException
    /* applet instance creation */
    new Loyalty (bArray, bOffset, (byte)bLength);
    * Select method returning true if applet selection is supported.
    * @return boolean status of selection.
    public boolean select()
    /* return status of selection */
    return true;
    * Deselect method.
    public void deselect()
    return;
    public void process(APDU apdu) throws ISOException
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
              ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
                   apdu.setIncomingAndReceive();
              byte[] apduBuffer = apdu.getBuffer();
    // writes the balance into the APDU buffer after the APDU command part
              creditPoints((byte)0x00);     
              apduBuffer[5] = (byte)(points >> 8) ;
              apduBuffer[6] = (byte)points ;
    // sends the APDU response
    // switches to output mode
              apdu.setOutgoing() ;
    // 2 bytes to return
              apdu.setOutgoingLength((short)2) ;
    // offset and length of bytes to return in the APDU buffer
              apdu.sendBytes((short)5, (short)2) ;
         public void creditPoints(byte pTobeCredited)
    points += pTobeCredited;
    public Shareable getShareableInterfaceObject(AID client, byte param){
              if(param != (byte)0x00)
                   return null;
         return (this);
    second code is :
    package com.gemplus.examples.oppurse;
    * Imported packages
    import javacard.framework.*;
    import visa.openplatform.*;
    import com.gemplus.examples.loyalty.*;
    public class OPPurse extends javacard.framework.Applet
    // the APDU constants for all the commands.
         private final static byte INS_GET_BALANCE = (byte)0x30 ;
         private final static byte INS_DEBIT      = (byte)0x31 ;
         private final static byte INS_CREDIT      = (byte)0x32 ;
         private final static byte INS_VERIFY_PIN = (byte)0x33 ;
         private final static byte INS_SET_NAME                    = (byte)0x34 ;
         private final static byte INS_GET_NAME                    = (byte)0x35 ;
    // the OP/VOP specific instruction set for mutual authentication
         private final static byte CLA_INIT_UPDATE = (byte)0x80 ;
         private final static byte INS_INIT_UPDATE = (byte)0x50 ;
         private final static byte CLA_EXTERNAL_AUTHENTICATE = (byte)0x84 ;
         private final static byte INS_EXTERNAL_AUTHENTICATE = (byte)0x82 ;
    // the PIN validity flag
    private boolean validPIN = false;
    // SW bytes for PIN Failed condition
         // the last nibble is replaced with the number of remaining tries
         private final static short      SW_PIN_FAILED = (short)0x63C0;
         private final static short SW_FAILED_TO_OBTAIN_SIO = (short)0x63D0;
         private final static short SW_LOYALTY_APP_NOT_EXIST = (short)0x63E0;
    // the illegal amount value for the exceptions.
    private final static short ILLEGAL_AMOUNT = 1;
    // the maximum balance in this purse.
    private static final short maximumBalance = 10000;
    // the current balance in this purse.
    private static short balance;
    /*     byte[] loyaltyAID = new byte[]{ (byte)0xA0,(byte)0x00,(byte)0x00,(byte)0x00,
              (byte)0x19,(byte)0xFF,(byte)0x00,(byte)0x00,
              (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
              (byte)0x00,(byte)0x00,(byte)0x02,(byte)0x02};*/
    /* Security part of declarations */
    // the Security Object necessary to credit the purse
    private ProviderSecurityDomain securityObject = null;
    // the security channel number
    byte secureChannel = (byte)0xFF;
    // the authentication status
    private boolean authenticationDone = false;
    // the secure channel status
    private boolean channelOpened = false;
         private byte[] nameBuffer = new byte[6];
    * Only this class's install method should create the applet object.
    protected OPPurse(byte[] buffer, short offset, byte length)
    // data offset is used for application specific parameter.
    // initialization with default offset (AID offset).
    short dataOffset = offset;
    if(length > 9) {
    // Install parameter detail. Compliant with OP 2.0.1.
    // | size | content
    // |------|---------------------------
    // | 1 | [AID_Length]
    // | 5-16 | [AID_Bytes]
    // | 1 | [Privilege_Length]
    // | 1-n | [Privilege_Bytes] (normally 1Byte)
    // | 1 | [Application_Proprietary_Length]
    // | 0-m | [Application_Proprietary_Bytes]
    // shift to privilege offset
    dataOffset += (short)( 1 + buffer[offset]);
    // finally shift to Application specific offset
    dataOffset += (short)( 1 + buffer[dataOffset]);
    // checks wrong data length
    if(buffer[dataOffset] != 2)
    // return received proprietary data length in the reason
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + offset + length - dataOffset));
    // go to proprietary data
    dataOffset++;
    } else {
    // Install parameter compliant with OP 2.0.
    if(length != 2)
    ISOException.throwIt((short)(ISO7816.SW_WRONG_LENGTH + length));
              // retreive the balance value from the APDU buffer
    short value = (short)(((buffer[(short)(dataOffset + 1)]) & 0xFF)
              | ((buffer[dataOffset] & 0xFF) << 8));
    // checks initial balance value
    if(value > maximumBalance)
    ISOException.throwIt(ISO7816.SW_DATA_INVALID);
              // initializes the balance with the APDU buffer contents
    balance = value;
    // register this instance as an installed Applet
    register();
    // ask the system for the Security Object associated to the Applet
    securityObject = OPSystem.getSecurityDomain();
    // applet is personalized and its state can change
    OPSystem.setCardContentState(OPSystem.APPLET_PERSONALIZED);
    // build the new ATR historical bytes
    byte[] newATRHistory = new byte[]
    // put "OPPurse" in historical bytes.
    (byte)0x4F, (byte)0x50, (byte)0x50, (byte)0x75, (byte)0x72, (byte)0x73, (byte)0x65
    // !!! ACTIVATED IF INSTALL PRIVILEGE IS "Default Selected" (0x04). !!!
    // change the default ATR to a personalized's one
    OPSystem.setATRHistBytes(newATRHistory, (short)0, (byte)newATRHistory.length);
    * Method installing the applet.
    * @param installparam the array constaining installation parameters
    * @param offset the starting offset in installparam
    * @param length the length in bytes of the data parameter in installparam
    public static void install(byte[] installparam, short offset, byte length )
    throws ISOException
    // applet instance creation with the initial balance
    new OPPurse(installparam, offset, length );
    * Select method returning true if applet selection is supported.
    * @return boolean status of selection.
    public boolean select()
    validPIN = false;
    // reset security if used.
    // In case of reset deselect is not called
    reset_security();
    // return status of selection
    return true;
    * Deselect method.
    public void deselect()
    // reset security if used.
    reset_security();
    return;
    * Method processing an incoming APDU.
    * @see APDU
    * @param apdu the incoming APDU
    * @exception ISOException with the response bytes defined by ISO 7816-4
    public void process(APDU apdu) throws ISOException
    // get the APDU buffer
    // the APDU data is available in 'apduBuffer'
    byte[] apduBuffer = apdu.getBuffer();
    // the "try" is mandatory because the debit method
    // can throw a javacard.framework.UserException
    try
         switch(apduBuffer[ISO7816.OFFSET_INS])
    case INS_VERIFY_PIN :
         verifyPIN(apdu);
    break ;
    case INS_GET_BALANCE :
         getBalance(apdu) ;
    break ;
    case INS_DEBIT :
         debit(apdu) ;
    break ;
                        case INS_SET_NAME :
                             setName(apdu);
                        break;
                        case INS_GET_NAME :
                             getName(apdu);
                        break ;
    case INS_CREDIT :
         credit(apdu) ;
    break ;
    case INS_INIT_UPDATE :
    if(apduBuffer[ISO7816.OFFSET_CLA] == CLA_INIT_UPDATE)
    // call initialize/update security method
         init_update(apdu) ;
    else
    // wrong CLA received
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    break ;
    case INS_EXTERNAL_AUTHENTICATE :
    if(apduBuffer[ISO7816.OFFSET_CLA] == CLA_EXTERNAL_AUTHENTICATE)
    // call external/authenticate security method
         external_authenticate(apdu) ;
    else
    // wrong CLA received
    ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
    break ;
    case ISO7816.INS_SELECT :
    break ;
    default :
    // The INS code is not supported by the dispatcher
         ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED) ;
    break ;
         }     // end of the switch
    } // end of the try
              catch(UserException e)
    // translates the UserException in an ISOException.
              if(e.getReason() == ILLEGAL_AMOUNT)
    throw new ISOException ( ISO7816.SW_DATA_INVALID ) ;
    //- P R I V A T E M E T H O D S -
         * Handles Verify Pin APDU.
         * @param apdu APDU object
         private void verifyPIN(APDU apdu)
    // get APDU data
              apdu.setIncomingAndReceive();
    // get APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
    // check that the PIN is not blocked
    if(OPSystem.getTriesRemaining() == 0)
    OPSystem.setCardContentState(OPSystem.APPLET_BLOCKED);
    // Pin format for OP specification
    // |type(2),length|nible(1),nible(2)|nible(3),nible(4)|...|nible(n-1),nible(n)|
    // get Pin length
    byte length = (byte)(apduBuffer[ISO7816.OFFSET_LC] & 0x0F);
    // pad the PIN ASCII value
    for(byte i=length; i<0x0E; i++)
    // only low nibble of padding is used
    apduBuffer[ISO7816.OFFSET_CDATA + i] = 0x3F;
    // fill header TAG
    apduBuffer[0] = (byte)((0x02 << 4) | length);
    // parse ASCII Pin code
    for(byte i=0; i<0x0E; i++)
    // fill bytes with ASCII Pin nibbles
    if((i & 0x01) == 0)
    // high nibble
    apduBuffer[(i >> 1)+1] = (byte)((apduBuffer[ISO7816.OFFSET_CDATA + i] & 0x0F) << 4);
    else
    // low nibble
    apduBuffer[(i >> 1)+1] |= (byte)(apduBuffer[ISO7816.OFFSET_CDATA + i] & 0x0F);
    // verify the received PIN
    // !!! WARNING PIN HAS TO BE INITIALIZED BEFORE USE !!!
    if(OPSystem.verifyPin(apdu, (byte)0))
    // set PIN validity flag
    validPIN = true;
    // if applet state is BLOCKED then restore previous state (PERSONALIZED)
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
    OPSystem.setCardContentState(OPSystem.APPLET_PERSONALIZED);
    return;
         // the last nibble of returned code is the number of remaining tries
              ISOException.throwIt((short)(SW_PIN_FAILED + OPSystem.getTriesRemaining()));
    * Performs the "getBalance" operation on this counter.
    * @param apdu The APDU to process.
    private void getBalance( APDU apdu )
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
    // writes the balance into the APDU buffer after the APDU command part
              apduBuffer[5] = (byte)(balance >> 8) ;
              apduBuffer[6] = (byte)balance ;
    // sends the APDU response
    // switches to output mode
              apdu.setOutgoing() ;
    // 2 bytes to return
              apdu.setOutgoingLength((short)2) ;
    // offset and length of bytes to return in the APDU buffer
              apdu.sendBytes((short)5, (short)2) ;
         private void setName(APDU apdu)
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
              // the operation is allowed only if master pin is validated
         if(!validPIN)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
              byte[] apduBuffer = apdu.getBuffer();
              apdu.setIncomingAndReceive();     
              for(short i=0,k=5;i<6;i++,k++)
                   nameBuffer[i] = apduBuffer[k];
         }//end of setName
         private void getName(APDU apdu)
              // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
                   byte[] apduBuffer = apdu.getBuffer();
                   for(short i=5, k=0;i<11;i++,k++)
                        apduBuffer=nameBuffer[k];
                   apdu.setOutgoing();
                   apdu.setOutgoingLength((short)6);
                   apdu.sendBytes((short)5,(short)6);
         }//end of storeName
    * Performs the "debit" operation on this counter.
    * @param apdu The APDU to process.
    * @exception ISOException If the APDU is invalid.
    * @exception UserException If the amount to debit is invalid.
    private void debit(APDU apdu) throws ISOException, UserException
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // the operation is allowed only if master pin is validated
         if(!validPIN)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
         // Gets the length of bytes to recieved from the terminal and receives them
    // If does not receive 4 bytes throws an ISO.SW_WRONG_LENGTH exception
              if(apduBuffer[4] != 2 || apdu.setIncomingAndReceive() != 2)
              ISOException.throwIt(ISO7816.SW_WRONG_LENGTH) ;
              // Reads the debit amount from the APDU buffer
    // Starts at offset 5 in the APDU buffer since the 5 first bytes
    // are used by the APDU command part
              short amount = (short)(((apduBuffer[6]) & (short)0x000000FF)
    | ((apduBuffer[5] << 8 ) & (short)0x0000FF00));
    // tests if the debit is valid
    if((balance >= amount) && (amount > 0))
    // does the debit operation
    balance -= amount ;
    // writes the new balance into the APDU buffer
    // (writes after the debit amount in the APDU buffer)
    apduBuffer[7] = (byte)(balance >> 8) ;
    apduBuffer[8] = (byte)balance ;
    // sends the APDU response
    apdu.setOutgoing() ; // Switches to output mode
    apdu.setOutgoingLength((short)2) ; // 2 bytes to return
    // offset and length of bytes to return in the APDU buffer
    apdu.sendBytes((short)7, (short)2) ;
              /*short points = 10;
    AID loyaltyID = JCSystem.lookupAID(loyaltyAID, (short)0, (byte)loyaltyAID.length);
              if(loyaltyID == null)
                   ISOException.throwIt((short)(SW_LOYALTY_APP_NOT_EXIST));
              TestInterface sio = (TestInterface)(JCSystem.getAppletShareableInterfaceObject(loyaltyID, (byte)0x00));
              if(sio == null)
                   ISOException.throwIt((short)(SW_FAILED_TO_OBTAIN_SIO));
              sio.creditPoints(points);*/
    else
    // throw a UserException with illegal amount as reason
    throw new UserException(ILLEGAL_AMOUNT) ;
    /* byte points = (byte)0x0A;
              //short points = 10;
    AID loyaltyID = JCSystem.lookupAID(loyaltyAID, (short)0, (byte)loyaltyAID.length);
              if(loyaltyID == null)
                   ISOException.throwIt((short)(SW_LOYALTY_APP_NOT_EXIST));
              TestInterface sio = (TestInterface)JCSystem.getAppletShareableInterfaceObject(loyaltyID, (byte)0x00);
              if(sio == null)
                   ISOException.throwIt((short)(SW_FAILED_TO_OBTAIN_SIO));
              sio.creditPoints(points);*/
    * Performs the "credit" operation on this counter. The operation is allowed only
    * if master pin is validated
    * @param apdu The APDU to process.
    * @exception ISOException If the APDU is invalid or if the amount to credit
    * is invalid.
    private void credit(APDU apdu) throws ISOException
    // check valid Applet state
    if(OPSystem.getCardContentState() == OPSystem.APPLET_BLOCKED)
                   ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
    // the operation is allowed only if master pin is validated and authentication is done
         if (!validPIN || !authenticationDone)
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // get the APDU buffer
    byte[] apduBuffer = apdu.getBuffer();
              // gets the length of bytes to recieved from the terminal and receives them
    // if does not receive 2 bytes throws an ISO.SW_WRONG_LENGTH exception
              if(apduBuffer[4] != 2 || apdu.setIncomingAndReceive() != 2)
    throw new ISOException(ISO7816.SW_WRONG_LENGTH) ;
              // reads the credit amount from the APDU buffer
    // starts at offset 5 in the APDU buffer since the 5 first bytes
    // are used by the APDU command part
              short amount = (short)(((apduBuffer[6]) & (short)0x000000FF)
    | ((apduBuffer[5] << 8) & (short)0x0000FF00));
    // tests if the credit is valid
    if(((short)(balance + amount) > maximumBalance) || (amount <= (short)0))
    throw new ISOException(ISO7816.SW_DATA_INVALID) ;
    else
    // does the credit operation
    balance += amount ;
    * Performs the "init_update" security operation.
    * @param apdu The APDU to process.
    private void init_update( APDU apdu )
    // receives data
    apdu.setIncomingAndReceive();
    // checks for existing active secure channel
    if(channelOpened)
    // close the openned security channel
    try
    securityObject.closeSecureChannel(secureChannel);
    catch(CardRuntimeException cre2)
    // channel number is invalid. this case is ignored
    // set the channel flag to close
    channelOpened = false;
    try
    // open a new security channel
    secureChannel = securityObject.openSecureChannel(apdu);
    // set the channel flag to open
    channelOpened = true;
    // get expected length
    short expected = apdu.setOutgoing();
    // send authentication result
    // expected length forced to 0x1C
    apdu.setOutgoingLength((byte)0x1C);
    apdu.sendBytes(ISO7816.OFFSET_CDATA, (byte)0x1c);
    catch(CardRuntimeException cre)
    // no available channel or APDU is invalid
    ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);
    * Performs the "external_authenticate" security operation.
    * @param apdu The APDU to process.
    private void external_authenticate( APDU apdu )
    // receives data
    apdu.setIncomingAndReceive();
    // checks for existing active secure channel
    if(channelOpened)
    try
    // try to authenticate the client
    securityObject.verifyExternalAuthenticate(secureChannel, apdu);
    // authentication succeed
    authenticationDone = true;
    catch(CardRuntimeException cre)
    // authentication fails
    // set authentication flag to fails
    authenticationDone = false;
    // close the openned security channel
    try {
    securityObject.closeSecureChannel(secureChannel);
    } catch(CardRuntimeException cre2) {
    // channel number is invalid. this case is ignored
    // set the channel flag to close
    channelOpened = false;
    // send authentication result
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    // send authentication result
    ISOException.throwIt(ISO7816.SW_NO_ERROR);
    else
    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
    * The "reset_security" method close an opened secure channel if exist.
    * @return void.
    public void reset_security()
    // close the secure channel if openned.
    if(secureChannel != (byte)0xFF)
    try
    // close the openned security channel
    securityObject.closeSecureChannel(secureChannel);
    catch(CardRuntimeException cre2)
    // channel number is invalid. this case is ignored
    // reset security parameters
    secureChannel = (byte)0xFF;
    channelOpened = false;
    authenticationDone = false;
    return;
    and the 3rd code is:
    package com.gemplus.examples.loyalty;
    import javacard.framework.Shareable;
    public interface TestInterface extends Shareable
    // public void creditPoints(byte points) ;
              public void creditPoints(byte points) ;
    Thanks in advance......

    Thanks. I know they are not the same thing. A package cannot be deleted if it contains one or more applets.
    I tried to delete by typing in the applet AID first, but it just doesn't work. And of course it doesn't work for package AID.
    Both the package and applet AID are generated in JBuilder, which looks like this, package AID(6D 79 70 61 63 6B 61 67 31),
    applet AID(6D 79 70 61 63 30 30 30 31),
    instance AID(6D 79 70 61 63 30 30 30 31)
    I've tried those three AIDs, it's not working.
    Thanks.

  • Portal SSO to a Java Applet

    Hello,
    I have a customer that is looking to set up SSO with an application that uses a Java Applet as its login screen to the app.
    Any advice on how this can be set up. SSO via External Application doesn't seem to work since it doesn't use a GET or POST method.
    Thank You!
    Padmini

    An applet (with normal security setup) can only open up socket connections to the host from whence the applet came. Sounds like your applet is trying to talk to port 5000 on the client's box. Can't do that, unless:
    a) The client's box is the server (which is the case under your first scenario)
    b) The applet is signed or otherwise set up to be "trusted" that it doesn't contain harmful code.
    The security policy is there for a reason. I, for example, wouldn't want to stumble across some rogue applet out on the internet which then tries to open up socket connections to things on my corporate intranet or local machine -- unless I KNEW it was going to do that (I "trust" it).

  • Mysterious null pointers during Applet.paint(g)

    I'm working with the paint function of my applet, which uses double buffering, and I occassionally get an odd null pointer exception, which does not halt its excution, but I believe may be linked to some other unusual behavior regarding components not being painted correctly.
    I've been staring at this thing for a while now and I am completely out of ideas.
    For debugging purposes, I've expressly checked each object invovled in the painting to ensure that it isn't null, but the exception is still being thrown and java is telling me that the exception is being trown on line numbers that have only a closing brace (see code)
    Any help is much appreciated
    Here's the code... state is an extension of Container and loading is just a label to display when I'm changing different containers in and out of state
           public void paint(Graphics g) {
              if(offscreen == null) offscreen = createImage(500, 480);
              else {
                      Graphics g1 = offscreen.getGraphics();
                      if(!dontPaint) {
                        if(loading != null && loading.isVisible()) loading.setVisible(false);
                        if(state!=null) state.paint(g1);
                   else {
                        if(g1 != null) {
                             g1.setColor(Color.black);
                             g1.fillRect(0, 0, 500, 480);
                        if(!loading.isVisible() && loading!=null) loading.setVisible(true);
                      if(g != null) g.drawImage(offscreen, 0, 0, null);
            }here's an example of the errors:
    java.lang.NullPointerException
            at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:48)
            at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:715)
            at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:147)
            at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2782)
            at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2772)
            at StarDart.paint(StarDart.java:113)
            at StarDart.update(StarDart.java:96)
            at sun.awt.RepaintArea.paint(RepaintArea.java:172)
            at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
            at java.awt.Component.dispatchEventImpl(Component.java:3586)
            at java.awt.Container.dispatchEventImpl(Container.java:1437)
            at java.awt.Component.dispatchEvent(Component.java:3367)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:190)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:144)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

    I do have a thread which is always running; I use the Runnable interface. Here is my run() function:
         public void run() {
              while(!stopRunning) {
                   for(; sessionInput(); state.handleInput(inBuf));
                           repaint();
                        try {
                                   Thread.sleep(100L);
                        } catch(InterruptedException interruptedexception) { System.out.println(interruptedexception); }
              }The for loop manages my networking code. Should I be putting the call to repaint() in a try block?
    Does this have something to do with synchronization?

Maybe you are looking for