java

Weaknesses of Hibernate

I would like to know which are the weak points of Hibernate 3. This is not pretended to be a thread against Hibernate. I think it will be a very useful knowledge for decide if Hibernate is the best option for a project or for estimating its time. A weakness can be: A bug Where JDBC or PLSQL are better Performance issues ... Also, ca...

What does Container.validate() method do?

There seems to be many methods in Java awt Container class that are related to validate. Apparently they don't do data validation. Is it useful for a Swing developer in any cases? Some of the methods: validate(), invalidate(), validateTree(), isValid() etc. ...

Running MATLAB function from Java

I have an .m file in MATLAB which I would like to call from Java an get the solution as a string or whatever in Java. This sounds really simple but for some reason I can't make it work. I tried this: matlab -nosplash -wait -nodesktop -r myFunction but I'm not sure how I parse the answer since MATLAB opens it's own command line (in W...

How to deploy to jboss a file folder into a jar?

Hi. I'm developing a Jboss web service that requires to access files which are in a folder of the project. When I deploy the web service, it creates a .jar, but the folder doesn't go inside of it, even if I added it to build path. How do i tell jboss to place the folder inside of the .jar? Thanks in advance. ...

Apache Velocity Which Variables's are Availible in Template

Is it possible to get a list of variables inside the template and fill them in using the list? I would like my users to create their templates that means i won't know before hand what variables will be available? EDIT: In my template users will decide what gets printed. Such as $users $latest but from my application i won't know wh...

Locking and Updating a File Accordingly

Note: I have read other posts on how to lock and unlock a file. I didn't find anything special that I wasn't aware of. So I am gonna put my scenario here so that someone can give some suggestions out. In my experience, FileChannel.lock doesn't guarantee the situation of locking and unlocking of a File when different Objects from multipl...

JBoss MBeans: How to have an array attribute?

Is it possible to define a MBean with an array attribute. I currently have an MBean defined as: <mbean code="corp.app.jmx.DNSServer" name="corp.app:service=DNSServer"> <attribute name="Server"> 192.168.0.1 192.168.0.2 192.168.0.3 </attribute> </mbean> In the MBean code I then split the String. However - for my next MBean I nee...

Detecting cyclic dependencies with Maven

In my application I'm using an external library (Batik 1.7) that is made up of several modules. The modules have multiple cyclic dependencies between themselves. This doesn't influence the build, but some tools (e.g. the M2Eclipse Dependency Graph, or the Dependencies report) will not work anymore. Is there a good way to diagnose what c...

Is the Apache Commons Collections framework faster than the JDK collections framework?

I have always been using the stock JDK collections in my code. Does the Apache Commons Collections framework run faster? ...

Best job description for a position requiring extensive debugging skills?

I am looking for suggestions regarding a job description for a Java (server-side) developer. The position requires primarily maintenance programming on a relatively stable product, but also requires extensive debugging capability. We've had difficulty in the past with people being uninterested in diving through through tons of log data...

Domain name resolution not working in Java Applications on Ubuntu64 9.04 machine. All other software resolves DNS correctly.

I have an number of Java applications installed on an Ubuntu64 9.04 PC, and none of them can resolve domain names (there are multiple JRE's too - some of them are IBM products). If I put the domain name in the hosts file with it's associated IP address, then the Java apps work for those domains only. Every other non Java program - like p...

How to integrate Spring Security and GWT?

I'm trying to integrate Spring Security and GWT. I'm also using gwt-incubator-security. I configured everything as it was described on their wiki pages. I managed to get security working by using intercept-url, but I can't get it working using annotations. Any ideas about what the problem is? P.S. I'm using Spring 2.5.6, Spring Security...

Static Access to HashMap/Array?

Here's an example of a static method that is used in a web application. As you can see, the String[] allergensArr gets insantiated each time that this method is called. It's threadsafe since it's in a static method but it's an expensive call. What are some other ways that the allergensArr[] can be used so that it's not instantiat...

Can GWT be made accessible for users with JavaScript disabled?

My question concerns Google Web Toolkit (GWT). I'm about to begin development for a project that will reside on an Intranet where some users may have JavaScript disabled. After seeing what GWT has done for Google Wave I've been very interested in learning and applying it to this new project, but if it isn't accessible to those users then...

How to define XSD for spring-ws contract to return a serialized image?

I'm trying to put together a contract-first web application using Spring-WS. I want to define an operation that the client can invoke by providing no parameters and simply get back from the server an Image that it can draw on the screen. My guess for how to do this is to define an ImageRequest XML snippet, such as: <ImageRequest xmlns...

L shaped java application window

I want to create a java application that is the shape of an "L" so that the application only occupies the left and bottom borders of the screen. I also do not want the normal borders and title bar at the top. I've seen other people creating circles and other shapes like that, but no complex shapes. This is for a windows xp computer an...

Comparison between Sun Metro and Apache CXF for webservices development?

What are the relative strengths and weaknesses between Sun Metro and Apache CXF for webservice development in Java. Is there another framework that I should be looking at as well? ...

BlazeDS Destination destroy()?

I have a BlazeDS destination and the scope is set to request. Is there a way to get BlazeDS to call destroy() when the request is complete? Is there another way to know when the request is complete? I know I can use finalize(), but that is only called when garbage collection occurs. Thanks, Matt ...

How can I effectively test (unit/integration) concurrent code in Java?

I saw this post on SO already but it still begs the question, at least for Java. It seems that this should be a pressing issue for any app (i'm testing a web app for this use case) that's multi-threaded. How have you guys dealt with it in a way that allows your threads to interleave -- inherently meaning testing random thread behavior. ...

Can you get the filename of the jsp file using a taglib in the taglib code

Is it possible to get the filename of the jsp file that uses a taglib from the java code? I.e. public int doStartTag() throws JspException { try { String xxx = pageContext.? Where xxx would get the filename of the jsp file (which of course could be a nested include file) br /B ...