java

error appears in jdeveloper 11g 11112

hi all, i need help on compiling my project in jdeveloper 11g. previously my application (jsp+servlets) works smoothly in jdeveloper 10g with oc4j (deploys in WAR file). but since i migrate to jdeveloper 11g, it appears several errors like this : <Nov 27, 2009 1:13:50 PM WIT> <Error> <Deployer> <BEA-149265> <Failure occurred in the exec...

SMack API in java

public void processMessage(Chat chat, Message message) { if (message.getType() == Message.Type.chat) System.out.println(chat.getParticipant() + " says: "+ message.getBody()); **processmsg** = message.getBody(); System.out.println("Message from Friend -----:"+**processmsg**); } Hi.how to use this p...

DWR/OpenSessionInView "Session is Closed!" in Java and Hibernate

They say that a closed session in hibernate and webapp with ajax is a common problem with java and spring so I have to set the OpenSessionInViewInFilter in the web.xml like this <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextCon...

Require help to implement drag from Java Application and drop to Native File System

I have a Java Swing application which shows a list of the files/Folders that have been uploaded to the server. I have a requirement to download selected file(s)/folder(s) to native file system using Drag and Drop . I have searched links but almost every link describes the Drag and Drop within a Java Swing application. My requirement is t...

Graph Theory: Find the Jordan center?

I'm trying to find the set of vertices that minimizes their distance to other vertices on a weighted graph. Based on a cursory wikipedia search, I think that this is called the Jordan Center. What are some good algorithms for finding it? Right now, my plan is to get a list of the weight for each branch emanating from a given vertex. The...

Signing PDF - multiple signatures with a single revision

Hi, To put it simply - I want to add multiple signatures on a PDF (using iText), without adding new revision for each. I've read the following thread, and it makes much sense (since Bruno wrote the answer) It is obvious, that if the document has 2 revisions, the first signature doesn't cover the second revision. However, is it possibl...

Multithreaded Java server: allowing one thread to access another one

Hopefully the code itself explains the issue here: class Server { public void main() { // ... ServerSocket serverSocket = new ServerSocket(PORT); while (true) { Socket socket = serverSocket.accept(); Thread thread = new Thread(new Session(socket)); thread.start(); } // .. } public...

Preventing NaN from being persisted by Hibernate

I am using Hibernate as my JPA provider with it connecting to a Progress database. When a NaN value is persisted it is causing lots of problems - it prevents the row from being read in certain circumstances. Is there a way to hook in to the standard double type persistence to convert NaN (and probably + and - infinity) to a different val...

Is the implements clause also inheritable?

When a class implements an interface, do the subclasses inherit the implemented interfaces too? For example class A implements Runnable { public void run() { // do something } } class B extends A { public static void main(String[] args) { new Thread(new B()).start(); //works } } does this mean the implem...

NaN problem in Java

I am converting four bytes to float and I'm getting NaN as a result, but I want the value 0.0. What am I doing wrong? This is my code: public class abc { public static void main(String[] args) { int[] arry = { 255, 255, 255, 255 }; int num = ((arry[0] << 24) & 0xFF000000) | ((arry[1] << 16) & 0xFF0000) | ((...

Enable pdf caching in IE

At first, caching didn't work in all browsers. Then I made it work in all browsers but IE (IE8) by adding .pdf extension to the url. Servlet stopped being called after that. I display pdf file inline on the webpage via EMBED tag that loads the following url: http://localhost:7001/app/viewFile.pdf Which is generated by java servlet wi...

How to develop authentication with resteasy?

I'm making small web service(1) and I decided to use resteasy to make it. But I need to know what would be best practise to develop authentication with resteasy. And what kind of responses webservice should send? Are responses usually in XML or what format, and what format of XML response should be? Btw. I use jboss 4 and Java 5. http...

HibernateTransactionManager : possible to throw exception without rollback ?

In Spring, I have declared a method to be transactional. I use HibernateTransactionManager. Now, I would like to throw an exception from this method, but I do not want hibernate to rollback the transaction. Is it possible to specify wich exceptions cause the rollback ? ...

frequency analysis algorithm

Hello everyone. I want to write a java program that searches through a cipher text and returns a frequency count of the characters in the cipher, for example the cipher: "jshddllpkeldldwgbdpked" will have a result like this: 2 letter occurrences: pk = 2, ke = 2, ld = 2 3 letter occurrences: pke = 2. Any algorithm that allows me to ...

Using Clients IP as the Servers IP

Hi All, This might be one of those "huh, why?" questions, but I figured it would be worth the try. How would one, from a server-side application, use the clients IP address as the applications IP address to another website? The basic idea is that any work the server side application does, is seen as the client itself doing the work, an...

MS Access - Can't Open Any More Tables using JdbcOdbcDriver

Hi, at work we have to deal with several MS Access mdb files, so we use the default JdbcOdbcBridge Driver which comes with the Sun JVM and, for most cases, it works great. The problem is that when we have to deal with some larger files, we face several times exceptions with the message "Can't open any more tables". How can we avoid tha...

jax-ws: how to get a handle to start/end of processing incoming soap message

Situation: jax-ws web service on Weblogic appserver; wsdl first development, jaxb customizations in external binding file. I would like to get a handle to the actual jaxb context that will process the incoming soap xml message, before it has been unmarshalled into java objects. Then I would like to get the unmarshaller of this jaxb con...

Synchronizing on two or more objects (Java)

I have code similar to following: public class Cache{ private final Object lock = new Object(); private HashMap<Integer, TreeMap<Long, Integer>> cache = new HashMap<Integer, TreeMap<Long, Integer>>(); private AtomicLong FREESPACE = new AtomicLong(102400); private void putInCache(TreeMap<Long, Integer> tempMap, int fileNr){ i...

How To Track No Sound Area In A Wav File?

Hello, everyone. How to track sections without sounds in a wav file? a small software what I want to develop is deviding a wav file, and it consider a no volume area as a deviding point. how can a program know that volume of a wav file is low? I'll use Java or MFC. ...

Mysql read data immediately after writing?

I am using a MySQL DB and a Java JDBC client to access it. I have a Table that contains session information. Each session is associated with a SessionToken. This token is a Base64 encoded String of a Hash of some of the session values. It should be unique. And is defined as varchar(50) in the db. When I try to lookup a session by its...