Am I doing something really stupid here? I am trying to execute a method every minute or so, forever, or until I stop the program.
while(true) {
this.doSomethingPeriodically();
Calendar now = Calendar.getInstance();
int minutes = now.get(Calendar.MINUTE);
int resume = minutes + 1;
while (now.get(Calendar.MINUTE) < resume) {
...
Context
We have this application, using about 60 coding projects.
We have several products that are realized using this same code base, so
we follow the maven best-practices : we assemble each product using an assembly project, using the assembly plugin.
We have an historical assembly using Ant, that need many improvements. In a firs...
Is there a way to mechanically translate goto statements to if, switch, while, break, and continue statements, etc, or with function calls, objects, anything?
...
I want to push arbitrary XMLEncoded java objects back and forth using Dojo cometd channels, and I have a problem decoding the payload properly.
In order to do this I have this send method in a stripped down version of the chat room client demonstration program:
private void send(String string) {
Map<String, Object> map = new HashMap<...
Hello.
Where I work, we have a policy in place that states we should try to build web services "bottom-up" (code-first).
When doing this, how can I add restrictions within my XSD <types> WSDL element? For example, in the following:
import javax.jws.WebService;
import javax.xml.ws.BindingType;
@WebService
@BindingType(javax.xml.ws.soa...
I'm trying to build simple echo server as RMI application (step by step as it's described in Sun tutorial).
All source code is shown below, it's very simple:
package test;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface EchoServer extends Remote {
public String sendString (String str) throws RemoteExcept...
I'm working on an Android Application for AutiPlan, which is a web-based planner tool for people with an Autism-related disorder.
I want to create an application which shows the current activity (planned item), together with a clock. (AnalogClock) On this clock, I want to paint a red background from the current-minute to the minute at w...
I annotated a XmlAdapter class like so:
@XmlTransient
public class DateTimeXmlAdapter extends XmlAdapter<String, DateTime> {
but schemagen.exe generates
<xs:complexType name="xmlAdapter" abstract="true">
<xs:sequence/>
</xs:complexType>
so does't skip the class, which was what I expected. XmlAdapter indeed is an abstract clas...
For e.g,
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));
JAXB Tutorial
...
The tool schemagen.exe generates xsd definitions from classes, e.g. the result is
<xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="aa/bb" xmlns:a="aa/bbb" xmlns:tns="aa/bb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
when I put in package-info.class on the package level:
@XmlSchema(namespace = "aa/bb",
...
I have three hierarchical layers injected in Spring - rest, business logic and database operations. Junit tests for BL and DAO are working OK, when rest can inject only business logic ioc layer.
My supper class for junit tests:
import org.springframework.test.AbstractTransactionalSpringContextTests;
public class AbstractTest extends A...
I'm looking for a reputable Java implementation of a topological sort, given a directed graph of dependencies (node #7 depends on node #2, node #2 depends on note #4, etc.), that will detect the presence of a cycle so I can report an error if a cycle occurs.
I assume Apache ant has to do this so I'm hoping I could just make use of it, b...
hello,
i am getting an excepetion when i try to read an object from an ObjectInputStream via network like this:
Socket socket = new Socket("localhost", 4444);
ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
while ((Object o = ois.readObject()) != null) {
}
Here is the exception I get:
java.io.EOFException
...
Hi Guys, a bit of help.
I have an application which executes multiple queries (query1, query2, query3) against a DB, retrieves data and then publishes that data.
The way I went about designing it was:
a. Have a DB class which encapsulated the connection, query execution, transforming resultset to POJOs.
b. A publisher class which kno...
Reading through "Thinking in Java" i stuck in ex:6 of Inner Classes chapter.
Exercise 6: (2) Create an interface with at least one method, in its own package. Create a
class in a separate package. Add a protected inner class that implements the interface. In a
third package, inherit from your class and, inside a method, return an obj...
Is it possible to call Maven goals from Java, for instance, can I do the equivalent of:
mvn clean package
from a Java class?
thanks,
Nick
...
Hi all,
I hava 2 objects associate by oneToMany relationship("One Model can have many events").
I'm trying to make a subquery in ejbql to find models for one event, like this:
SELECT model
FROM RegModelValue model
WHERE :event IN (model.events)
....
but toplink doent recognize model alias and tell me "Internal Exception: line 1:12...
I must be really stupid, but I'm at my wits' end with a JPA issue, using MyEclipse 7.5.
I am accessing a DB2 database (on an AS400) via JPA. I have reverse-engineered a simple table to provide a DAO with some precision "find" methods. So far so good.
If I run a SELECT statement over the table thus, I get 4 rows:
SELECT * FROM MyTable ...
I was curious what kinds of obstacles have you encountered when migrating my app from seam 2.0 to 2.1.
Obvious ones are mentioned in: migration guide, but I encountered some problems with rule based security, that are not mentioned there.
Firstly I want to post descriptions of my problems and my solutions with migration, so people can...