java

Java - Use Return Value as Parameter in another Method - Memory Management

Considering internal memory usage input = web_service.FullCompanyListChunksGet(x, ChunkSize); ReadXML(input); should take the same memory as ReadXML(web_service.FullCompanyListChunksGet(x, ChunkSize)); Doesn't it? Do both samples pass just the reference to the ReadXML Method? Please help me understanding the difference. Thanks ...

Android and IOException - strange error

Hi. I'm trying to write a basic application with http get request. Eclipse validated my code, but when I using IOException in Android console I have this strange messages: trouble writing output: null [2009-07-29 17:22:49 - myapp] Conversion to Dalvik format failed with error 2 And my application doesn't load into the emulator. This i...

Ehcache performance on a large cluster

I would like to use Ehcache replicated cache, first as the backend to Hibernate second level cache, second as a cache for any data. I know how a distributed cache like memcached is working, and I know it can scale to large clusters, but I cannot find how Ehcache replication behaves on large clusters. Has someone a pointer to some info...

help with java type erasure.

Hello good people! in my long journey to learn about hibernate, i wanted to use generic DAO and came across a good article at the hibernate site and tried out the IMPLEMENTATION WITH HIBERNATE Section.I'm having an error saying :GenericDAOImpl.java:[22,16] name clash: makeTransient(T) in GenericDAOImpl and makeTransient(T) in GenericDAO ...

What is an efficient way to parse a String in Java?

How should I parse the following String using Java to extract the file path? ? stands for any number of random charaters _ stands for any number of white spaces (no new line) ?[LoadFile]_file_=_"foo/bar/baz.xml"? Example: 10:52:21.212 [LoadFile] file = "foo/bar/baz.xml" should extract foo/bar/baz.xml ...

What's wrong with beans binding

I am starting work on a project that has some code written in BeansBinding. It seems to work, but I found this scary post: http://weblogs.java.net/blog/fabriziogiudici/archive/2009/03/lets_fork_beans.html It appears that development on BeansBinding has stopped. Why wouldn't this ambitious developer just pick up where the other develop...

Does a variable accessed by multiple threads in a java servlet need to be declared volatile?

In the book Java Servlet Programming, there's an example servlet on page 54 which searches for primes in a background thread. Each time a client accesses the servlet, the most recently found prime number is returned. The variable which is used to store the most recently found prime is declared as such: long lastprime = 0; Since this...

StringListProperty in GAE/J

Is there StringListProperty just in Python or in Java too? I cant find it in the Java API. ...

warning in faces-config.xml integrating spring with jsf

Hello, I am trying to integrate spring into a jsf application. In faces-config.xml I have included this: <application> <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> but it shows a weird warning which I...

Allowing Java to use an untrusted certificate for SSL/HTTPS connection

Hello, I've been working on a program to extract information from a dynamic web application, and the program worked fine until I set my tomcat server to use SSL using a self-signed(thus, untrusted) certificate. The stack trace of the error is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path bui...

Java getDefaultToolKit() hangs Mac OS X 10.5

I am using Eclipse Cocao on Mac OS X 10.5.7, and the program hangs on the innocent line below while initializing variables. If I take it out, the program proceeds. Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); This line works fine in XP, Vista, Server 2003, and Mac OS X 10.4.11. I have no idea why it infi...

If we are not allowed to use static variables in session beans, how to define a logger ?

Time and again, I read that we are not supposed to use static variables in a session bean. Then, how am I supposed to get a logger for this bean and use it all over the bean methods ? ...

AWTUtilities Transparent JFrame

Using this article from sun. I am trying to create a transparent window. I have one image inside a label on the frame. I want the image to be visible but the frame invisible. When i use try { Class awtUtilitiesClass = Class.forName("com.sun.awt.AWTUtilities"); Method mSetWindowOpacity = awtUtilitiesClass.getMethod("setWindowO...

html:text tag not working

I have a form that looks somewhat like this: public class MaintainForecastInputForm extends ActionForm { private MainMenuForm mainMenuForm = new MainMenuForm(); public SelectProdLineAssociationForm selectProdLineAssociationForm = new SelectProdLineAssociationForm(); private EconometricDataForm econometricDataForm = new Econome...

Getting multiple Java pop3 clients to work with GMail.

Hello, I have written a nice program in Java that connects to a gmail account and download atachments sent to it. Once an attachment has been downloaded, it is marked as read and is not downloaded ever again. This program will have to run in multiple instances with each program downloading unique attachments so that a single attachment i...

Need to either convert RAW print data to ps/pdf or print it from Java.

Our application is a client/server setup, where the client is a standalone Java application that always runs in Windows, and the server is written in C and can run on either a Windows or a Unix machine. Additionally, we use Perl for doing various reports. Generally, the way the reports work is that we generate either a text file or an ...

Calling the listing function in jpl

Hello, I was wondering whether anyone had managed to use the 'listing.' command in JPL to examine the contents of the Prolog knowledgebase? JPL requires you construct queries and will return solutions based on the variables which you set in the query. For example (Java): Query q = new Query("holdsAt((X,Y) = true, 3)"); while ( q.hasM...

Java: Connection refused but netstat says otherwise

I have several nodes acting as both servers and clients using Java's TCP sockets, i.e., Socket and ServerSocket. Each node uses persistent connections to communicate with 4 to 10 neighbors. However, sometimes a node (node1) may throw the following exception when trying to connect to another node (node2): java.net.ConnectException: Conne...

Java Wrapper to Perl/Python code

I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call some code using other l...

Is it possible to bulk delete from a many-many association with HQL?

And if so, what is the syntax? Assume that I want an instance of Foo to be unassociated from all instances of Bar: In SQL it would simply be: delete from FOO_BAR_MAPPING where FOO_ID = ? In HQL, I assumed it would be something like: delete from Bar.foos foos where foos.id = :id (where foos is a mapped collection of Foo) But appea...