java

Can an Ant build script to reference the Eclipse plugin folder without full path details?

I could use the following: <fileset dir="C:\Program Files\eclipse\plugins\myplugin"> <include name="extraStuff.jar" /> </fileset> But that breaks the build file on someone else's PC who did not install eclipse into the default folder. In my case I can't use basedir without hard folder references. Is there a 'shortcut' to the ecl...

2D overlap line chart

Hi Does any one know of an API that would allow me to draw something like this. It would need some interactivity to it zooming change second dimension axis angle I was looking at JFreeChart but I don't see any example of doing 2D overlap chart. Thanks ...

java webstart decompiler

Is there anyway to decompile java webstart application? ...

What's the best way to share business object instances between Java web apps using JBoss and Spring?

We currently have a web application loading a Spring application context which instantiates a stack of business objects, DAO objects and Hibernate. We would like to share this stack with another web application, to avoid having multiple instances of the same objects. We have looked into several approaches; exposing the objects using JMX...

What are the differences / similarities between JBI and SCA

Could point me to some good links, or share experiences of the differences / similarities between the JBI and SCA specifications? Many thanks :-) ...

JPA - map entity to sql query?

Hi, I'm writing a JPA connector to a legacy sistem. The problem is, DB design in the system is.. well.. horrible. I need to implement an entity that maps to three tables. I can do it using named sql queries, but the probem is, I have to use this entity in a OneToMany relation (this entity is on the many side). So how do I tell JPA it n...

JCanvas3D vs Canvas3D

Hi, Can anyone please tell me the issues that we face when using JCanvas3D instead of Canvas3D? How to achieve transparency using JCanvas3D? Regards, hariprasad ...

Session management using Hibernate in a Swing application

How do you do your Hibernate session management in a Java Desktop Swing application? Do you use a single session? Multiple sessions? Here are a few references on the subject: http://www.hibernate.org/333.html http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/ http://in.relation.to/Bloggers...

Is there a no-duplicate List implementation out there?

Hey all, I know about SortedSet, but in my case I need something that implements List, and not Set. So is there an implementation out there, in the API or elsewhere? It shouldn't be hard to implement myself, but I figured why not ask people here first? thanks, Yuval =8-) ...

Swing: Canvas overlaps menu

I have a JFrame with a menu bar and a canvas covering all the remaining surface. When I click on the menu bar, the menu opens behind the Canvas and I can't see it. Has anyone experienced this? Other than resizing the Canvas (which I am reluctant to do) is there any solution? Thanks, Vlad ...

Uninitialized variables and members in Java

Consider this: public class TestClass { private String a; private String b; public TestClass() { a = "initialized"; } public void doSomething() { String c; a.notify(); // This is fine b.notify(); // This is fine - but will end in an exception c.notify(); // "Local variable c may not have been ...

Accessing a ColdFusion datasource from Java code

I have a servlet that I would like to run within ColdFusion MX 7. I would like to make use of an existing ColdFusion DSN as a javax.sql.DataSource, if possible. I thought something like coldfusion.server.ServiceFactory.getDataSourceService().getDatasource(dsname); would work, but unfortunately the servlet returns java.lang.NoClassD...

Hibernate Transaction Manager Issue

I am new to Hibernate and attempting to run a java/spring example that retrieves data from a table in MS SqlServer. Everytime I try to run the program, the data source loads ok. But when spring tries to load the session facotry it gets the following error: Exception in thread "main" org.springframework.beans.factory.BeanCreationExcepti...

In Java, how to I call a base class's method from the overriding method in a derived class?

Hello everybody, I have two Java classes : B, which extends another class A, as follows : class A { public void myMethod() { /* ... */ } } class B extends A { public void myMethod() { /* Another code */ } } I would like to call the A.myMethod() from the B.myMethod(). I am coming from the C++ world, and I don't know ho...

Understanding JDBC internals

[1] In JDBC, why should we first load drivers using Class.forName("some driver name"). Why SUN didnt take care of loading driver within the getConnection() method itself.If I pass driver name as a parameter to the getConnection() method. [2] I want to understand JBDC internals.Any pointers towards it are appreciated. ...

Besides EAR and EJB, what do I get from a J2EE app server that I don't get in a servlet container like Tomcat?

We use Tomcat to host our WAR based applications. We are servlet container compliant J2EE applications with the exception of org.apache.catalina.authenticator.SingleSignOn. We are being asked to move to a commercial J2EE application server. The first downside to changing that I see is the cost. No matter what the charges for the app...

SAX parser breaking on ñ

I have implemented a SAX parser in Java by extending the default handler. The XML has a ñ in its content. When it hits this character it breaks. I print out the char array in the character method and it simply ends with the character before the ñ. The parser seems to stop after this as no other methods are called even though there is sti...

Handling UTF-8 encoding

We have an Java application running on Weblogic server that picks up XML messages from a JMS or MQ queue and writes it into another JMS queue. The application doesn't modify the XML content in any way. We use BEA's XMLObject to read and write the messages into queues. The XML messages contain the encoding type declarations as UTF-8. We...

Are Anonymous Classes a bad idea?

After using them a while I can't help but feel that the hoops you're forced to jump through when using anonymous classes are not worth it. You end up with final all over the place and no matter what the code is more difficult to read than if you'd used a well named inner class. So what are the advantages of using them? I must be missi...

How to specify firstDayOfWeek for java.util.Calendar using a JVM argument

I'm trying to change default firstDayOfWeek for java.util.Calendar from SUNDAY to MONDAY. Is it possible to achieve this through JVM configuration instead of adding this piece of code? cal.setFirstDayOfWeek(Calendar.MONDAY); ...