Marco Tulio Borges

Ranch Hand
+ Follow
since Sep 14, 2004
SCJP 1.4 (95%) / SCWCD 1.4 (91%) / SCBCD (77%) / SCEA (next...)
Brazil
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marco Tulio Borges

That's it! The problem was not in the saved file, but in the way the file was handled by Ant. While the file was saved, compiled and tested in Eclipse with the AppletViewer, it ran just fine. But when I was compiling, packaging and signing it with ant before the applet went to the web server, there was a problem: ant was not using the same encoding as Eclipse to compile the files. I just added the encoding parameter to the javac tag of the ant build and it worked! Thanks for the tip about the file encoding!
9 years ago

Ulf Dittmer wrote:you'd need to specify the file encoding during compilation; are you doing that?


Yes, I live in Brazil, so most of our messages and documentation come in ISO-8859-1 flavour. The source code is fine. What really bugs me is that in AppletViewer, the same code works as it is supposed to work... Hummm... But then again, before it goes to the browser, it passes through an ant script for compiling and packaging. I will check into that and get back here.
9 years ago
You are right, I have been using the applet tag all along, but I thought the jsp:plugin tag was a good option, since it has a fallback option and has the hability to specify the JRE version. Since it isn't working, I'm back on <applet>.

Thank you!
9 years ago
Well, I did not change the default font. I have tried the default look and feel and the Windows look and feel, both had the same problems. The problems only happen when I am using the applet on the browser: it does not happen when the applet is running on AppletViewer.

About the Font, I haven't changed it, since I am using:



I tried using getFont() from JApplet, but it returns null, however, when I try (using Windows look and feel):

then I get:

Console wrote:javax.swing.plaf.FontUIResource[family=Tahoma,name=Tahoma,style=plain,size=11]


both on browser and on AppletViewer.

Ulf Dittmer wrote:Are you talking about the dialog title or the dialog contents?


The contents.


As an addition (and I am editing the post because of this), I tried the call:

and got a true as a result.
9 years ago
Hello there! I have a strange problem using the jsp:plugin tag for applets. In Firefox 3.6, the tag was transformed to <embed> and <object>, but Firefox could not find the right plugin to execute the applet. Firefox shows a message stating that I need a plugin for this kind of content, but when I try to download it, it also says that it does not know which plugin (it states that the plugin is needed for the content-type application/x-java-applet). The problem does not occur under IE8. I have Java Plugin installed (jre 6.0 update 20) and applets that use the <applet> tag work just fine.

Has anyone seen this happen before?

The jsp:plugin code:


And the generated code:
9 years ago
Hello, there! I have an applet that needs to show messages to users using JOptionPane. The web page containing the applet is configured to use ISO-8859-1, but when the applet displays a message using JOptionPane, the message appears with squares in place of "é", "ã", "ó" or any characters with these signs.

The page that contains the applet is:


Do you have any ideia of what might be happening.
I am using:
  • Java 6 update 20
  • IE 8 and FF 3.6 (both presented the same problem)
  • Tomcat 5.5


  • 10x in advance!
    9 years ago
    I have passed SCBCD 5.0 yesterday. It has been almost 3 years since SCWCD... Ok, this time I got only 77% :roll: (47 questions out of 61), but with about 3 weeks of study. I used Mastering EJB 3.0 (4th Ed.), Mikalai Zaikin's SCBCD 5.0 Guide and Enthuware's EJBPlus V5 for SCBCD 5.0.

    I read the Mastering EJB book up to the chapter about Timers, used appendix B and D for reference, as well as MK's Guide and took the tests from EJBPlus. That and some background knowledge from EJB 2.1 and Entities helped me get the certification. Ok, it was only 77%, but with only 3 weeks (my voucher was about to expire), I think it is a good outcome, after all.

    Now, time to put some extra effort to get my SCEA!
    10 years ago
    After much work, I found a solution... Actually, not one, but three! After many changes in my search terms on Google, one post with 3 solutions came to me: Storing Images with Oracle and Hibernate (Paperplanes). The actual problem is the way the Blob was mapped to Java: I have a byte[] mapped to it. The weird thing is that in Tomcat this was handled and in OAS this was not... Anyway, the solution is to use a Spring implementation of a Hibernate UserType that maps Blobs to byte[]. I still have to test this solution for inserting data in the Blob, but I'm confident that it will work. If it doesn't, this forum will hear from me tomorrow. Spring rules! Thanks to Mathias Meyer, the guy from Paperplanes, who helped me and probably doesn't know yet.
    10 years ago
    Hello! I'm developing an application using Oracle Application Server 10.1.2.0.2 (which uses J2EE 1.3 spec), Hibernate (3.2), Java 1.4.2 and Oracle 10g Database, which I connect to with a datasource configured in my application (the config is at the end of the post).

    The problem is: I have a Blob Column on a table and I can write data to it, but I can't load data from it. For test purposes, I ran the application on Tomcat 5.0.28 and the Blob data is there (~130KB), but doing the same thing on OAS didn't work (I only got 86 bytes , and no errors ). The thing is: when the data was saved, I was using OAS.

    Any ideas?

    Oh, one more thing... I cannot change the application server on the client (neither its version).



    [ August 26, 2008: Message edited by: Marco Tulio Borges ]

    I have to edit this so I can say that I found out that 86 bytes is the size of the Blob locator on Oracle DB, so I'm getting nothing when loading my blob in OAS...
    [ August 27, 2008: Message edited by: Marco Tulio Borges ]
    10 years ago
    I have a problem with Hibernate (Annotations). Here are my Entities:



    This one works just fine. The other one that does not is here:



    Now, the problem: before I persist ProblemEntity, I call:



    After this code, I try to save my ProblemEntity and then flush the session object (the same session that retrieved e1). Even though e1 is not transient and has a valid ID (I checked it), Hibernate tries to insert both problemEntity and e1 (in this order). What am I doing wrong? (both classes are mapped in hibernate.cfg.xml)
    [ May 21, 2008: Message edited by: Marco Tulio Borges ]
    Hello, there Ranch folks! I'm facing a problem with multi-level inheritance in Hibernate, mixing inheritance strategies. I have not found any examples or solutions to this particular problem on the web, so let me try to describe it:

    This is my class hierarchy:


    A (abstract class)
    |-B (abstract class)
    | |-C
    | |-D
    |-E


    In other words: C and D extend B while E and B extend A. Classes B and A are abstract.

    My database is set this way: I have a table named "table_A", a table named "table_B" and a table named "table_E".

    I'm using Java 5 with Hibernate 3.2.1 (with Annotations 3.2.0). The mapping looks like this:



    The real problem happens when I'm trying to query for a list of entities of type A. Looks like Hibernate is not trying to instantiate C and D by the single table strategy. Hibernate is trying to resolve C and D using the InheritanceType.JOINED strategy, looking for tables with names "C" and "D", since the name of the table is not specified. Apparently Hibernate is ignoring the second strategy (InheritanceType.SINGLE_TABLE). I read somewhere (hard to find out where, after so many searches) that Hibernate can handle mixing strategies in this multi-level inheritance problem. What am I doing wrong?
    [ January 11, 2008: Message edited by: Marco Tulio Borges ]
    I agree with Jothi: there are more projects using Servlets and JSP than projects using EJB, for 2 main reasons: not everyone needs something as big and heavy as EJB and there are very good substitutes for it. You just can't say the same thing about JSPs and Servlets.

    Good luck!
    That's it! As Anil has pointed out, a session gets created for every JSP page that don't have a session attribute set to "false" in the page directive.
    Thank you all. Special thanks to Bert who helped me on the exam (although he probably wasn't aware of that, since I bought his book )
    13 years ago
    I hope I find you here with the new certificate too ASAP!
    13 years ago