java

CXF IllegalAnnotationException related to no-arg StackTraceElement constructor

I have a web service built using Apache CXF 2.1.3. One of the web params is a java.lang.Throwable. When I call JaxWsServerFactoryBean.setServiceBean, I get an IllegalAnnotationException as java.lang.StackTraceElement doesn't have a no-arg constructor. The JIRA bug report here claims to have fixed the problem, but I am still getting the ...

Is there an XPS viewer that can be built into a web page, as iPaper can?

Hello, Does anyone know of a an XPS viewer that can be built into a webpage that would access XPS files hosted on our server in the same way that iPaper does for pdfs? (Coming up with an automated conversion process for these XPS files to PDF has proven quite difficult.) Thanks a bunch, Jake ...

How can a java library be ported to the web?

How do you take a java library that is for the desktop or an applet and make it so you can use its functions for a web page? I know not all things are meant for the web, but can you call a "regular" java class in an apache/tomcat setup server and it "work"? Do you have to so something to it to get it work with a web page? I was intere...

How to customize series fill in area chart via BIRT chart API?

I am trying to create a gradient fill for a series in an area chart that I am building through the BIRT chart API, but the book "Integrating and Extending BIRT" and the Interwebs seem curiously silent about how to get it to work. It seems no matter what I do, I always get a flat color from the default palette. I've tried using SeriesDefi...

Java thread wait and notify

I have two threads. Thread A is pulling some elements from queue and thread B is adding some elements to the queue. I want thread A to go to sleep when the queue is empty. When thread B adds some element to the queue it should make sure that thread A is working. How can this be done in Java? ...

Can one obtain actual stack size used by a thread in Java after some time of running?

The idea would be to help determine the optimum stack size for a given Java application. One thing that could be done with this information create a range-table of stack sizes which the threads could modify as they exit and which could be dumped periodically and at application exit. EDIT: This is in the context of running on customer...

Java executors: how to be notified, without blocking, when a task completes?

Say I have a queue full of tasks which I need to submit to an executor service. I want them processed one at a time. The simplest way I can think of is to: Take a task from the queue Submit it to the executor Call .get on the returned Future and block until a result is available Take another task from the queue... However, I am try...

Cons'ing a List in Java

Say I have a java.util.List list and I want to create a new List by adding an element e to the beginning of list (i.e., I want to cons e and list). For example, if list is [1,2,3,4] and e is 5, then cons(e,list) will be [5,1,2,3,4] It's OK for the elements of list and cons(e,list) to be shared, but list should not be modified. Wha...

swing editor ui for applicationContext.xml beans?

I asked this in spring forums but got no answer, and I just discovered stackoverflow, so Ill try here. I am using spring 2.0.5. In my app I need to let the user add/modify/delete (via the UI) beans that are described in the applicationContext.xml file. The beans that are to be edited are all of the same class (like a db table crud edito...

ClassCastException when casting to the same class.

Hi, I have 2 different java projects, one has 2 classes dynamicbeans.DynamicBean2 dynamic.Validator On the other project, I load both of these classes dynamically and store them on an Object class Form { Class beanClass; Class validatorClass; Validator validator; } I then go ahead and create a Validator object using v...

How can I suppress MATLAB's command window when calling it from Java?

I am calling MATLAB with Java but I want to suppress the command window of MATLAB to make users feel that I use only one program which is Java. In addition I read about something called standalone executable for MATLAB, but it didn't work; will that help me? ...

Spring MVC, one controller for "add" and "update" when using setDisallowedFields?

So I've got a simple form through which I can either "add" a new Thing, or "update" an existing Thing. What I would like is to have one controller that can process both adding and updating. On the outset this seems simple enough, until I consider the problem of using setDisallowedFields in my InitBinder so that the "id" field is not al...

ZipInputStream doesn't report *actual* (i.e. compressed) bytes read...

Hi all. Love this website! My issue is as follows: I'm reading a zip file that's coming over a network from an HTTP "PUT" request. The request header tells me that the Content-Length is (say) 1Mb. The following code creates the ZipInputStream, and saves the zip contents to files in the current directory: ZipInputStream zis = new Zi...

Obtaining a Hibernate transaction within a Spring class

I am working on a program that uses Spring and obtains Hibernate transactions transparently using a TransactionInterceptor. This makes it very convenient to say "when this method is invoked from some other class, wrap it in a transaction if it's not already in one." However, I have a class that needs to attempt a write and must find ou...

print method in java

hello every body , I want to ask you about the print vector array , the following one: Vector[] routingTable = new Vector[connectivity.length]; I tried this method , but it doesn't work with me and it gives me protocol.Route@c17164 when i printed in the main, here is the code, so can you tell me why it doesn't print the correct valu...

Trouble calling an applet method from page

I know it's not optimal, but I have to work with it, a page making calls to the applet. My problem is, when I do so, I recieve a rather cryptic error message: "uncaught exception: Error calling method on NPObject! [plugin exception: java.lang.reflect.InvocationTargetException]." Can anyone decode this? Even multiple possibilities wo...

JAXB Marshalling and Generics

I am trying to use JAXB's introspection to marshall and unmashall some existing domain objects marked up with JAXB annotations. Most things work as expected, but I am having quite a bit of trouble getting a fairly simple class to serialize. This class is used as an @XmlElement on a number of beans and looks something like: public class ...

Hibernate Auditable many-to-many relationships

Consider the following hibernate configuration: <class name="Person"> <id name="id" column="personId"> <generator class="native"/> </id> <set name="addresses" table="PersonAddress"> <key column="personId"/> <many-to-many column="addressId" class="Address"/> </set> </class> <class name="Address"> <id name="id" column...

Has anyone gotten Recaptcha to run on the Google App Engine (in Java)?

I followed the recaptcha instructions and created a simple app that works if I run it in Eclipse using a local Tomcat server but the same files give an error (verify-params-incorrect) when validating the user's response when run in Eclipse using the local Google App Engine SDK. ...

Best book/ tutorial to learn/implement web services using java, xml and spring.

Hi, I am a newbie to web-services. What is a good way to learn web-services implementation using java, xml and spring? Are there any good books which cover this topic in good width? Or, are there any online resources, tutorials, etc.? Also, what would be good projects to understand this hands-on? Any recommendations>? ...