Java 1.5 problem with Mixer.getMaxLines

This worked in Java 1.4 (returning 32),
in Java 1.5 it returns -1
wha' happened?
DataLine.Info lineInfo = new DataLine.Info(SourceDataLine.class, playbackFormat);
Mixer mixer = AudioSystem.getMixer(null);
return mixer.getMaxLines(lineInfo);
Note: playbackFormat has the toString() value of: format = PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian
Please help, I used to have simultaneous sounds playing in my game now nothing and everything else seems fine in 1.5. I don't want to go back to 1.4...

I've got a solution found over on javagaming.org. It turns out that Java 1.4 was using a software mixer by default. So I changed my code to force it the mixer to be softwared.
This code creates a software mixer:
static Mixer mixer = null;
Mixer.Info[] mixers = AudioSystem.getMixerInfo();
for (int i = 0; i < mixers.length; i++) {
if ("Java Sound Audio Engine".equals(mixers.getName())) {
mixer = AudioSystem.getMixer(mixers);
This code now returns 32, which is what it did in Java 1.4 (instead of -1)
DataLine.Info lineInfo = new DataLine.Info(SourceDataLine.class, playbackFormat);
return mixer.getMaxLines(lineInfo);
This code now used to get a line
line = (SourceDataLine) mixer.getLine(lineInfo);
instead of
line = (SourceDataLine) AudioSystem.getLine(lineInfo);

Similar Messages

  • Java Webstart application problem with TLS certificate revocation checks (Java 1.7.0_76)

    We have a problem with our Java Web Start Application regarding the TLS certificate revocation check:
    The application is running on a server within a wide area network which is separated from the internet.
    The application users have access to the WAN, and also access to the internet over some corporate proxy/firewall.
    The user has to enter, for example "https://my-site.de/myapp/ma.jnlp" within a webbrowser or could also call  "javaws https://my-site.de/myapp/ma.jnlp" to start the application client.
    The webserver has a certificate from a trusted certificate authority. This certificate seems to be ok, the browser is even configured to perform OCSP status check.
    The application files are signed with a certificate from another trusted certificate authority. This certificate seems also to be ok. Regarding this certificate there
    are no problems with certificate revocation checks.
    The problem is, while starting the application client there is a message box which tell us something like "the connection to this website ist not trustworthy",
    "Website: https://my-site.de:80", and something about an invalid certificate, meaning the webserver certificate.
    Obviously the jvm runtime, which is executed on the users workstation, tries to perform a revocation check for the webservers certificate, but this fails because
    it cannot fetch the certificate under https://my-site.de:80.
    The application will execute without further problems after that message but the users are very concerned about the "invalid" certificate, so here are my questions:
    - Why is the application trying to get the webserver certificate over Port 80. Our application developers told me, there is no corresponding statement. Calling this address
      has to fail while "https://my-site.de:443" or "https://my-site.de" would not have a problem.
    - Is there a way to make the application go on without performing a tls revocation check? I mean, by adjusting the application sourcecode and not by configuring the users Java Control Panel.
      While disabling the TLS Certificate Revocation check in the Java Control Panel, the Webstart Application executes without a warning message, but this is not a workable solution for
      our users.
    It would be great if someone can help me with a hint so i can send our developers into the right direction;-)
    Many thanks!
    This is a part from a java console output after calling "javaws -verbose https://my-site.de/myapp/"
    (sorry for this is in german... and also my english above)
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    security: OCSP Response: GOOD
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    security: UNAUTHORIZED
    security: Failing over to CRLs: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
    network: Cacheeintrag gefunden [URL: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl, Version: null] prevalidated=false/0
    cache: Adding MemoryCache entry: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl
    cache: Resource http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl has expired.
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: ResponseCode für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: 200
    network: Codierung für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: null
    network: Verbindung mit http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl trennen
    CacheEntry[http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl]: updateAvailable=true,lastModified=Tue Mar 24 10:50:01 CET 2015,length=53241
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird
    network: Verbindung von socket://ldap.serverpass.telesec.de:389 mit Proxy=DIRECT wird hergestellt
    security: Revocation Status Unknown
    com.sun.deploy.security.RevocationChecker$StatusUnknownException: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
        at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
        at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.checkRevocationStatus(Unknown Source)
        at com.sun.deploy.security.X509TrustManagerDelegate.checkTrusted(Unknown Source)
        at com.sun.deploy.security.X509Extended7DeployTrustManagerDelegate.checkServerTrusted(Unknown Source)
        at com.sun.deploy.security.X509Extended7DeployTrustManager.checkServerTrusted(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
        at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
        at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
        at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.model.ResourceProvider.getResource(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory._buildDescriptor(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
        at com.sun.javaws.Main.launchApp(Unknown Source)
        at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
        at com.sun.javaws.Main.access$000(Unknown Source)
        at com.sun.javaws.Main$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException
            at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source)
            ... 35 more
    Caused by: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        ... 36 more
    security: Ungültiges Zertifikat vom HTTPS-Server
    network: Cacheeintrag nicht gefunden [URL: https://my-site.de:80, Version: null]

    Add the JSF Jars to the WEB-INF/lib directory of the application. If still getting error add to the CLASSPATH variable in the startWebLogic script in the domain/bin directory.

  • Java Front-end problems with Windows 200 Pro

    Hi,
    I have some problem on my pc with java applications front-end. I have windows 2000 Professional and use java(TM) 2 SDK, Standard Edition Version 1.3.1
    Using every java applications (also development environment as JBuilder 4 Professional and Together 4) I have always problems with front-end: the text is bad visualized everytime I use the scroolbar, menu items into a menu are bad visualized while I drag over of them the mouse and so on...
    To try to solve this my problem I have just installed Service Pack 2 for Windows 2000 Pro but I have not had good results - I keep to have the usual problem.
    I'm aware that it is difficult to reproduce and however if anyone has some idea to solve my problem I am opened to every suggestion.
    Thanks in advance

    the text says that what technolody that they are using its called "Off Screen Images" once i used them in my applications to improve the prefomance.
    What they says is to improve the time it takes to display componants that display text on them (Such as buttons, Labels...) they going to create an Off Screen Image of the text and then paste that image on to the screen whenever the componant has to be displayed/Re displayed instead of redrowing (Re rendering) the text on the screen repeatedly which take more time and processing power than rendering once and paste it to screen whenever needed but this solution will take some more memory.

  • Java.util.logging - Problem with setting different Levels for each Handler

    Hello all,
    I am having issues setting up the java.util.logging system to use multiple handlers.
    I will paste the relevant code below, but basically I have 3 Handlers. One is a custom handler that opens a JOptionPane dialog with the specified error, the others are ConsoleHandler and FileHandler. I want Console and File to display ALL levels, and I want the custom handler to only display SEVERE levels.
    As it is now, all log levels are being displayed in the JOptionPane, and the Console is displaying duplicates.
    Here is the code that sets up the logger:
    logger = Logger.getLogger("lib.srr.applet");
    // I have tried both with and without the following statement          
    logger.setLevel(Level.ALL);
    // Log to file for all levels FINER and up
    FileHandler fh = new FileHandler("mylog.log");
    fh.setFormatter(new SimpleFormatter());
    fh.setLevel(Level.FINER);
    // Log to console for all levels FINER and up
    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(Level.FINER);
    // Log SEVERE levels to the User, through a JOptionPane message dialog
    SRRUserAlertHandler uah = new SRRUserAlertHandler();
    uah.setLevel(Level.SEVERE);
    uah.setFormatter(new SRRUserAlertFormatter());
    // Add handlers
    logger.addHandler(fh);
    logger.addHandler(ch);
    logger.addHandler(uah);
    logger.info(fh.getLevel().toString() + " -- " + ch.getLevel().toString() + " -- " + uah.getLevel().toString());
    logger.info("Logger Initialized.");Both of those logger.info() calls displays to the SRRUserAlertHandler, despite the level being set to SEVERE.
    The getLevel calls displays the proper levels: "FINER -- FINER -- SEVERE"
    When I start up the applet, I get the following in the console:
    Apr 28, 2009 12:01:34 PM lib.srr.applet.SRR initLogger
    INFO: FINER -- FINER -- SEVERE
    Apr 28, 2009 12:01:34 PM lib.srr.applet.SRR initLogger
    INFO: FINER -- FINER -- SEVERE
    Apr 28, 2009 12:01:40 PM lib.srr.applet.SRR initLogger
    INFO: Logger Initialized.
    Apr 28, 2009 12:01:40 PM lib.srr.applet.SRR initLogger
    INFO: Logger Initialized.
    Apr 28, 2009 12:01:41 PM lib.srr.applet.SRR init
    INFO: Preparing Helper Files.
    Apr 28, 2009 12:01:41 PM lib.srr.applet.SRR init
    INFO: Preparing Helper Files.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Getting PC Name.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Getting PC Name.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Finished Initialization.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Finished Initialization.Notice they all display twice. Each of those are also being displayed to the user through the JOptionPane dialogs.
    Any ideas how I can properly set this up to send ONLY SEVERE to the user, and FINER and up to the File/Console?
    Thanks!
    Edit:
    Just in case, here is the code for my SRRUserAlertHandler:
    public class SRRUserAlertHandler extends Handler {
         public void close() throws SecurityException {
         public void flush() {
         public void publish(LogRecord arg0) {
              JOptionPane.showMessageDialog(null, arg0.getMessage());
    }Edited by: compbry15 on Apr 28, 2009 9:44 AM

    For now I have fixed the issue of setLevel not working by making a Filter class:
    public class SRRUserAlertFilter implements Filter {
         public boolean isLoggable(LogRecord arg0) {
              if (arg0.getLevel().intValue() >= Level.WARNING.intValue()) {
                   System.err.println(arg0.getLevel().intValue() + " -- " + Level.WARNING.intValue());
                   return true;
              return false;
    }My new SRRUserAlertHandler goes like this now:
    public class SRRUserAlertHandler extends Handler {
         public void close() throws SecurityException {
         public void flush() {
         public void publish(LogRecord arg0) {
              Filter theFilter = this.getFilter();
              if (theFilter.isLoggable(arg0))
                   JOptionPane.showMessageDialog(null, arg0.getMessage());
    }This is ugly as sin .. but I cannot be required to change an external config file when this is going in an applet.
    After much searching around, this logging api is quite annoying at times. I have seen numerous other people run into problems with it not logging specific levels, or logging too many levels, etc. A developer should be able to complete configure the system without having to modify external config files.
    Does anyone else have another solution?

  • Java Console Launch Problems with CITRIX

    I have to use a Citrix TerminalServer to connect to the SunMC Server.
    Reason is the nature of the RMI proto. RMI needs to open ports back on
    the console host. As this is not allowed in our network design, I first login to
    a CITIX T.S. , start a browser and then type the URL of the SunMC server.
    The page appeares, I select "Launch Java Console", then "Open with Java Web Start executable" and it starts Java 5. Now I would expect the Login Window, but instead of it I get a window saying:
    Checking for latest version ...
    After a while (timeout) I get:
    Unable to lauch Sun Management center
    Any ideas ?

    We opened a case at SUN and got the following statement:
    This is a know issue and actually the problem has been escalated to our developer colleagues: Bug 6665331
    Using java web start does not work on a firewalled environment. This is both on a windows as well as a solaris environment. So anyone who has enabled firewalled communication will be facing this issue. The momentarily workarounds you can apply are:
    - install the console directly on the window pc or Soalris environment and use the Java GUI or
    - set the variable "sunmc.server.console.firewall.Enable=false" into java.properties file.
    --> we installed the regular (non-Web-Start) Java Console on the Citrix host. It uses the configured ports, e.g. 45000-48000. and works fine.
    I think, this will also be needed on a normal windows (non-Citrix) host.
    The second suggested workaround did not show any effects.
    Conclusion: If there is a firewall in between the server and the console, the Java WebStart Console can not be used at the moment.

  • Java update causes problems with color printing in Mac 10.5

    Had a big problem with color printing for the last two weeks. Thought the printer was broken because it would freeze and refuse to be "seen", or would generate error messages. Bought new Samsung 315, and had the SAME problem. Bought new HP CP1518ni, and had the SAME problem. Not resolved after talking to tech support at both places.
    Looked for software updates around the time of the onset of printing problems. on May 15 installed "Java for Mac OS X 10.5 update" (1.0) (am running on 10.5.8). Removed the Java preferences files (com.apple.java......plist) and restarted.
    Problem solved! Clearly not the printer.

    Hmmm. This is about the time my printer stopped printing too. I've now had two printers in my house and had trouble with both of them. What a pain we should not have to delete updates for our stuff to work together.
    Renee

  • Java card plugin problem with NetBeans 6.8

    Hi, I've got a problem with the netBeans 6.8 i couldn't add a java card plugin at all. I try to run it with the netBeans 6.7.1 and it installs the plugin and adds the java card platform, but when i try to build a sample project I've got an error:
    java.lang.NoClassDefFoundError: ${javacard/packagerClass}
    Any ideas
    Netbeans versions: 6.7.1, 6.8
    JavaCard version: JCDK3.0.2_ConnectedEdition
    OS: WindowsXP

    first idea of all: isn't there a netbeans support forum/mailing list/plugin page ?
    regards
    sebastien

  • Word 2007 mail merge : problem with mixed portrait and landscape orientations

    Hi there,
    I have a 3 pages document Word 2007 file
    This is a mail merge I want to export in PDF using Adobe Acrobat Printer,
    then send "big" PDF to printing.
    page 1 is PORTRAIT
    page 2 is PORTRAIT
    page 3 is LANDSCAPE
    In PDF pages 1 and 2 are perfectly fine, inside an A4 format (width=210 height=297mm or something)
    but for page 3, system changed to a "double" sized page (A3 width=297 height=420) and printed my stuff at the 1st top middle of big page.
    So I have a big "double" sheet, oriented PORTRAIT, with my stuff in 1st half, and a blank in 2nd half.
    It seems that system did not rotate the page... and just put the stuff into a bigger sheet to "solve" at best.
    I would like the same size of paper (A4) but in landscape : width=297 height=210
    I have already seen many PDF with mixed portrait and landscape orientations, so what's the thing ?
    With my advanced thanks,
    And greetings from Paris, France !
    Vince

    Some questions:
    Which version of office were you using before? 2003?
    Are the data files on a network, or on your local machine? If they are on a network, can you make a copy of one of them on your local machine and try again?
    Can you open the files directly in Excel? What extension do they have (.xls, or something else?) I am wondering whether access to other file types has been left blocked on your machine but is allowed on your colleague's machine.
    Are you just opening the mail merge main document and seeing this message? If so, do you see the same thing if you start with a new document and try to connect to one of these data sources?
    Can you confirm that the message is about Access even though you are trying to connect to an Excel file?
    (Also, office 2007 has some new stuff - that let's you specify that certain folders are "trusted" . I don't think that ever affected MailMerge but it may be as well to make sure that your documents and data sources are in trusted locations).
    Also worth trying to start Word in "Safe mode" - see, e.g. http://office.microsoft.com/en-gb/word-help/work-with-office-safe-modes-HP010140792.aspx
    Peter Jamieson

  • JAI(Java Advanced Imaging) Problem with splitting TIFF images

    Hi
    I am getting problem with height when I use this program to split TIFF images
    ImageDecoder decImage = ImageCodec.createImageDecoder("tiff", inStr,
    null);
    Then it creates RenderedImage page by page and encodes them to file:
    String outFileName = "";
    OutputStream outStr;
    TIFFEncodeParam encParam = new TIFFEncodeParam();
    encParam.setCompression(TIFFEncodeParam.COMPRESSION_PACKBITS);
    for (int i=0,n=this.getPageCount(); i < n; i++)
    outImage = this.decImage.decodeAsRenderedImage(i);
    outFileName = "C:\\Temp\\Split" + i + ".tif";
    outStr = new FileOutputStream(outFileName);
    BufferedOutputStream bOutStr = new BufferedOutputStream(outStr);
    encImage = ImageCodec.createImageEncoder("tiff",bOutStr,encParam);
    encImage.encode(outImage);
    bOutStr.flush();
    bOutStr.close();
    }The images are shrinking when I split . I need a solution to this problem.
    Thanks for any help in advance
    Sudheer.

    Hi
    Did you get a solution for your problem. I am also trying to split a TIFF file.
    Thanks in advance
    Antony

  • 10.6.8 Causes New Problem with Mixed Graphics Hardware Environment - Suggestions?

    Hi. After installing the latest Mac OS update (10.6.8), I can no longer boot my 5,1 Mac Pro into its Mac OS partition.  An undefined display (and graphics card) now seems to be used as default, rather than the supported display/hardware, so I cannot interact with the user interface.  I simply have an inoperable blue screen on the correct display. I have 2 graphics cards in my Mac Pro: a supported GT120 (solely for the purpose of booting/using Mac OS), and an unsupported HD6970 (used extensively for Windows 7 3D gaming, in Slot 1).  Until this latest OS release, I could successfully boot and use my computer in both Mac OS and Windows environments.  I encountered other problems because of this mixed graphics environment, like an inability to put the system to sleep without having the Mac Pro PCI fan unnecessarily ramp up to full speed after waking - but it would always work correctly when first booted.  (I have contacted Apple Support about this sleep issue, but they do not support my configuration.) Does any boot command exist to force the use of the supported graphics card?  Or, do kext files exist to enable the Mac OS to at least recognize (not use) the 6970 card? With the 6970 removed, I have no problems booting the Mac OS, but I do NOT want to remove my hardware card every time I want to shift to the Mac OS.  Do anyone have any suggestions?

    Thanks for the suggestions.
    First, I cannot swap graphic cards in PCI slots, because the 6970 only operates correctly in slot 1 (the high-speed graphics slot).  I may have to revert to the prior OS release, but what about next month, with Lion?
    I am familiar with Netkas.org (I will probably try it or Groths.org next, thanks).  One of my previous graphics cards was a flashed 4970.  I do not have access to the prelease Lion kext files that he suggests using.  Full flash support does not appear to yet exist for the 6970, much less the HD 6990 or GTX 590 that it appears I may need next.
    Ideally, the Mac Pro firmware should ignore any attempted bus communication with an unrecognized PCI card.  Currently, it appears that the unsupported 6970 can cause boot or run-time problems (I also have occasional freezes during Mac OS hardware interaction like writing a file to disk).  Note that I have never had any problems arising from my unsupported Windows 5.1 PCI sound card, however.

  • Java.lang.ClassCastException problem with ApplicationModuleImpl

    Hi, to whom this may be familiar:
    This is from a oracle.adf.controller.struts.actions.DataAction class:
    public class SwitchDAAction extends DataAction
      protected void findForward(DataActionContext actionContext) throws Exception
        super.findForward(actionContext);
        ZBModuleImpl svc = (ZBModuleImpl) actionContext.getBindingContext().findDataControl("ZBModuleDataControl").getDataProvider();
        BillViewImpl oneUser = svc.getBillView1();
    ...ZBModuleImpl is an application module which extends oracle.lbo.server.ApplicationModuleImpl.
    As the last statement indicates, the purpose is to obtain an instance of a view object that is already in the application.
    There is no error at compilation. However, when the application runs, the embedded oc4j gives an error:
    WARNING: Unhandled Exception thrown: class java.lang.ClassCastExceptionand in the browser the first line in the "500 Internal Server Error", shown below, pin-points to the line of code that cast Object to ZBModuleImpl:
    at zb.view.SwitchDAAction.findForward(SwitchDAAction.java:18)I broke up the line into multiple lines to see where exactly the problem is:
    public class SwitchDAAction extends DataAction
      protected void findForward(DataActionContext actionContext) throws Exception
        super.findForward(actionContext);
        BindingContext bdCtx = actionContext.getBindingContext();
        DCDataControl dc = bdCtx.findDataControl("ZBModuleDataControl");
        Object dpd = dc.getDataProvider();
        ZBModuleImpl svc = (ZBModuleImpl) dpd;
        BillViewImpl oneUser = svc.getBillView1();
    ...The error messages always point to that line that does data type casting.
    What is the problem and what can be done to fix it? (I am using JDeveloper 10.1.2.0.0).
    Thanks for your help!
    Newman

    Hi, Valery and Anton:
    Sorry I did not mention the version of Jdev I am using in my last posting. It is 10.1.2. It is so precious someone around still know the older versions.
    Anton, since mine is an older version, I tried to set the custom properties. The name of my application is ZB and the name of the application module is ZBModuleImpl. The name of the view object I am trying to get an instance of is BillViewimpl.
    In the Application Module Editor for ZBModule, at the Custom Properties node, there are names for three properties in the drop-down list: DESCRIPTION, FILE_NAME, DATA_CONTROL_NAME. Not knowing what they are and what they are for, I tried to add two name/value pairs: DESCRIPTION/ZB and DATA_CONTROL_NAME/ZBModuleDataControl. And for the last method on the problem line of code I tried both getDataProvider() and getApplicationModule(), in the following combinations, and none of them work out:
                                                   getDataProvider()     getApplicationModule()
    DESCRIPTION/ZB (only)                                   X                       X
    DATA_CONTROL_NAME/ZBModuleDataControl (only)            X                       X
    (both)                                                  X                       XPlease correct me where I did wrong. I wonder what oracle.jbo.common.ws.WSApplicationModuleImpl is. I even tried
    BillViewImpl oneUser = (ZBModuleImpl) actionContext.getBindingContext().findDataControl("ZBModuleDataControl").getApplicationModule().findApplicationModule("ZBModuleImpl");
    and
    BillViewImpl oneUser = ((ZBModuleImpl) actionContext.getBindingContext().findDataControl("ZBModuleDataControl").getApplicationModule()getApplicationModule()).findViewObject("BillViewImpl");But the problem is always with the typecasting from ApplicationModule to ZBModuleImpl. Is there anything that WSApplicationModuleImpl can do to help out?
    Thanks a lot for your help!
    Newman

  • Java Applet Panel problems with CardLayout

    Hi, I have a problem a I have been stucked for 2 days.
    I created 3 Panels to use with CardLayout. I would switch between those 3 panels depending on user interaction. I have some textfields and text areas on the 2nd and 3rd Panel. On the 1st panel, I would like to use g.drawstring to write some stuff on that panel, but the words would be blocked off if it goes to where the components are on the other panels.
    Thanks.

    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    public class CardTest extends Applet
        Panel panel;
        CardLayout cards;
        public void init()
        {   cards = new CardLayout();
            panel = new Panel(cards);
            panel.add("one", new GraphicPanel());
            panel.add("two", getPanel("panel two"));
            panel.add("three", getPanel("panel three"));
            setLayout(new BorderLayout());
            add(getNavPanel(), "North");
            add(panel);
        private Panel getNavPanel()
            final Button
                last = new Button("last"),
                next = new Button("next");
            ActionListener l = new ActionListener()
                public void actionPerformed(ActionEvent e)
                    Button button = (Button)e.getSource();
                    if(button == last)
                        cards.previous(panel);
                    if(button == next)
                        cards.next(panel);
            last.addActionListener(l);
            next.addActionListener(l);
            Panel panel = new Panel();
            panel.add(last);
            panel.add(next);
            return panel;
        private Panel getPanel(String s)
            Panel panel = new Panel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weighty = 1.0;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            panel.add(new Button("button"), gbc);
            panel.add(new TextArea(s, 8, 16), gbc);
            return panel;
        public static void main(String[] args)
            Applet applet = new CardTest();
            Frame f = new Frame();
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            f.add(applet);
            f.setSize(400,400);
            f.setLocation(200,200);
            applet.init();
            f.setVisible(true);
    class GraphicPanel extends Panel
        Font font;
        String text;
        final int PAD = 25;
        public GraphicPanel()
            font = new Font("lucida bright regular", Font.PLAIN, 22);
            text = "Hello World";
        public void paint(Graphics g)
            super.paint(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            int dia = Math.min(w,h)/6;
            g2.setPaint(Color.blue);
            g2.drawLine(PAD, PAD, w - PAD, PAD);
            g2.drawLine(PAD, h - PAD, w - PAD, h - PAD);
            g2.setPaint(Color.green.darker());
            g2.drawOval(w/2 - dia/2, h*2/3, dia, dia);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            float width = (float)font.getStringBounds(text, frc).getWidth();
            LineMetrics lm = font.getLineMetrics(text, frc);
            float x = (w - width)/2;
            float y = (h + lm.getHeight())/2 -lm.getDescent();
            g2.setPaint(Color.black);
            g2.drawString(text, x, y);
    }

  • Java 6 causing problems with Forms 10.1.2.0.2

    I recently installed Sun Java 6 JRE to my Windows XP machine - I have previously been using Java 5 JRE (1.5.0_09).
    When I run my Forms applications from any of our appservers (10.1.2.0.2) (i.e. dev, test, prod) I can get by the login no problem but then get presented with a 'blank' browser window. I say 'blank' because the menu and status bar are present but no forms are displayed.
    In the Java console (tracing set at level 5) I see the following error ...
    network: Connecting http://dbdev.kelman.com:7780/forms/lservlet/;jsessionid=ac1d027f30d62f783e1e32bd4b9295bce539576dad6f.e3aNbxiTbNuMe38Kah0Sb34Pa3n0n6jAmljGr5XDqQLvpAe with cookie "oracle.uix=0^^GMT-7:00"
    network: Cache entry not found [url: http://dbdev.kelman.com:7780/forms/java/oracle/bali/share/sort/StringComparator.class, version: null]
    network: Connecting http://dbdev.kelman.com:7780/forms/java/oracle/bali/share/sort/StringComparator.class with proxy=DIRECT
    network: Connecting http://dbdev.kelman.com:7780/forms/java/oracle/bali/share/sort/StringComparator.class with cookie "oracle.uix=0^^GMT-7:00"
    Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: oracle/bali/share/sort/StringComparator
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    I uninstalled Java 6 and then was able to run the web forms just fine.
    I reinstalled Java 6 and I'm back to the same problem.
    Anyone run across this ?
    Message was edited by:
    markhooper
    null

    This is for the benefit of everybody who are trying to run Forms 10g on the web with Oracle Application Server 10.1.2.0.2 and JRE/JDK 1.6.
    Technically speaking Oracle Support's claims of not being able to certify Forms 10g on Java 1.6 has been due to the way JRE/JDK behaviour which has been changed from 1.6 onwards. Aparently from Java 1.6 onwards, there is a check for all the imported files while classes are being loaded. Although some are not needed by forms they are still checked and an error occurs if they are not present (Note: 748324.1).
    The solution to the problem is to apply the patch 10.1.2.3 (https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=5983622) which is about 1.7Gb for Linux-x86 platform.
    The underlying issue is the way FRMALL.JAR file not having the class oracle.bali.share.sort.StringComparator. Aparently from 10.1.2.3 onwards, Oracle have included this file in the FRMALL.JAR file as a standard bundle, which resolves the bug and completes the java archive.
    Alternatively, you may be able to try the one off patch 7384879 (FORMS 10.1.2.3 JAR FILE EXPIRE JANUARY 2009) which is about 4.6Mb from which you can extract the FRMALL.JAR file and replace the original file in the iAS installation.
    Though I have not tested this personelly, this could be a faster way out of the problem.

  • Java EE Tutorial - problem with the example Bookstore

    Hi,
    I've been working few days on a problem running the Bookstore example from the Java EE Tutorial. When I run the application, I'm redirected from the servlet BookStoreServlet to errorpage.html with the following message: The application is unavailable. Please try later. The tutorial troubleshooting reads: ... a servlet can’t retrieve the web context attribute representing the bookstore. This will occur if the database server hasn’t been started. But the database server is running (I'm running Derby bundled into NetBeans 6.5). The Glassfish admin console reads:
    StandardWrapperValve[BookStoreServlet]: PWC1406: Servlet.service() for servlet BookStoreServlet threw exception
    com.sun.bookstore.exception.BookNotFoundException: Couldn't find book: 203
            at com.sun.bookstore1.database.BookDBAO.getBook(BookDBAO.java:58)
            at com.sun.bookstore1.servlets.BookStoreServlet.doGet(BookStoreServlet.java:76)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
            at com.sun.bookstore1.filters.HitCounterFilter.doFilter(HitCounterFilter.java:71)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)This would indicate that the tables are empty, but they were created according to the tutorial, with the command ant create-tables, and I can see their content in NetBeans. Please help, I really need to run the examples.
    Best regards,
    Rene Puchinger

    I solved the problem running the command that is correctly explained in the page 97 of the tutorial:
    Ant create-tables
    My mistake was that until that day, I was believing that I could do everything inside Netbeans.
    For this you explicitly need to use ant.
    Then I got some error which I solved fixing the file
    C:\Java\JavaEETutorial5\examples\bp-project\ build.properties
    ( like set correctly the path to the server and so on)

  • Java to javascript problems with '

    I have a class that pass some strings to a javascript alert(<....>)
    In this sting I have some < ' > and when I launch the class I get always an alert with the ASCII code of < ' >.
    I used this syntax inside the String
    String alertSctring="Let \' go";
    but I get
    Let &#39 go
    Why?

    I'm sure the problem has to do with escaping values in strings in Java and Javascript.
    Try using double-backslash quote.. like "Let \\' Go"

Maybe you are looking for