java

Many-to-Many relationship in DataNucleus (JDO) doesn't persist

Hi, I don't manage to persist a many-to-many link with DataNucleus using JDO. I have two classes Book and Shop. This is the orm mapping file: <?xml version="1.0"?> <!DOCTYPE orm PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" "http://java.sun.com/dtd/orm_2_0.dtd"&gt; <orm> <package name="com.my...

Java circular Generics

I'm having a problem understanding Java generics and I've simplified to this example class A<T extends B> { public void fun(T t) { } } class B { A a; public void event() { a.fun(this); } } The problem is that this generates a warning because A is defined inside B but A is already using it as a generic typ...

Simple RSS parser for Android

Hello, I am trying to create my first Android application and I'm not all that experienced with Java development. In short, the application needs to do the following: On click, fetch a RSS feed online Parse it for data Show the data I've been browsing for guides, tutorials and documentation but the parsers I've found so far only deal...

xmlrpc vs json / rest on java google appengine with android client

Can someone please point me to a reference which gives a "full circle" example implementation of either (both with android client and java appengine back end) xmlrpc or json / rest ? I have found a python example but am struggling to find a java version. Bonus points (not really) but if anyone could provide one where the the transport m...

calculate frequency on certain range

Hi, I have maths problem ... (at the moment i solved it using manual iteration which is pretty slow) ... For example if an employee got paid weekly (it can be fortnightly / every 2 weeks and monthly) with certain date (let's call the employee got paid every tuesday and for monthly the employee paid on certain date). I have date range...

.Net equivalent to Java's AssertionError

In Java, I will occasionally throw an AssertionError directly, to assert that a particular line will not be reached. An example of this would be to assert that the default case in a switch statement cannot be reached (see this JavaSpecialists page for an example). I would like to use a similar mechanism in .Net. Is there an equivalent ...

Can Java load Mac OSX bundles/frameworks/ or dylib? How can it be done?

Can Java load Mac OSX bundles/frameworks/ or dylib? How can it be done? ...

switching between console mode and graphical mode

Hello. I just wanted to know if there is some way to switch between console mode and graphical mode. I am using java on swing. I'd like to know if I can type something in the shell to go to a console mode, then type something to go back to the desktop. Or if I can press some key at boot time, or something. The idea is to make my server...

JSTL for each problem

Hi all, I have a for each loop that it works fine when the items property is filled using an scriplet in the following way: <% List<LandingCategory> cats = beanFactory.getLandingCategories(); %> <c:forEach var="cat" items="<%=cats%>"> <c:out value="${cat.id}"/> </c:forEach> However, when trying to filled the items list w...

saving fileds value in ajax Operation by wicket

I have page which some text fields are added to it by ajax depending on user selection by some radio buttons but when user clicks on a radio and add a textfield, values of other fields miss. and I want to save the value of text fields. what should I do? ...

"Wrong" app gets pinned to taskbar (Windows 7)

I have an application that gets started via a shortcut. This application than starts a Java GUI application with CreateProcess(). When the Java application gets pinned to the taskbar the javaw.exe gets pinned to the taskbar instead of the "expected" shortcut. Only the native executable which launches Java can be modified - the shortcut ...

Java and JVM confusion (if Java can handle a large string why can't groovy?)

I recently ran into an issue with Groovy where I was attempting to deal with a very large string (100k characters). I got an error that said the string could not be more than 65,535 characters. I did some searches to try to find out more info and ran across this link that said the problem was with the JVM - http://jira.codehaus.org/bro...

How do I stop my command-line arguments being escaped in a maven plugin?

I have a plugin that uses the Plexus Commandline to invoke some external process and capture the output. One of the arguments is in a funny format with spaces and quotes, e.g. --range:"25 Aug 2008"-"04 Aug 2009". I have no way to change the required format of the argument, but Plexus detects the spaces in the argument and wraps the whole...

What architecture do I use for a Flex and Java application

Hi I am thinking of migrating a Java/Swing application to Flex3. The existing app architecture is as follows: Java/Swing client, JDO(Kodo) - Java Persistance engine, JMS - Messaging (for real time updates), EJBs - Business logic, Weblogic, UDB - Back-end database I am looking to reuse a lot of the java server side functionality of the ...

Does Zend Lucene need Java Lucene?

When implementing Zend Lucene, do we need to install Java on our server or not? ...

Why has my generic method stopped working?

In my project I have a factory method that loads an object that implements an interface. You pass in the class you desire and receive an instantiation of it, like so. public class Factory { public static <E extends SomeInterface> E load( Class<E> clss ) throws Exception { return clss.newInstance(); } } You could invoke...

extract boolean checks to local variables

Sometimes i extract boolean checks into local variables to achief better readability. What do you think? Any disadvantages? Does the compiler a line-in or something if the variable isn't used anywhere else? I also thought about reducing the scope with an additional block "{}". if (person.getAge() > MINIMUM_AGE && person.getTall() ...

Liferay Portlets AutoDeploy Issue on Eclipse when referencing projects

I developed two portlets, one for the admin and another for displaying information. They have the same back-end or DAO, model and services are the same. So I have decided to make another project to be referenced by the two portlet projects. It worked good when I started the Liferay server. But when I am editing and building the referenc...

Open Source Java library for conversion to HTML?

I know there are some Java libraries to create PDF files and the likes, but does anybody know of a Java library to convert various file formats to HTML, especially PDF and MS Word files? The purpose of this is to display a file preview in the web browser. Thanks in advance! ...

Disabling Local JMX Connections on JVM

Hi, We are writing a java program which keeps a password in memory. Unfortunately, the user can easily use jconsole or jmap to create a heap dump file and open it to find the password. I think jconsole connects jvm using local sockets. I wanna know, is there any way to disable jmx even for local users? Is there any way to totally disable...