java

hibernate HQL elements error

My HibernateUserImpl mapping look like below <set name="groups" table="OS_USER_GROUP" inverse="false" cascade="none" lazy="false"> <key column="user_id"/> <many-to-many column="group_id" class="com.opensymphony.user.provider.hibernate3.ahxu.impl.HibernateGroupImpl"/> </set> I do HQL query like select distinct hibuser from Hi...

Generic Interface

Hi All, Let's say I wanted to define an interface which represents a call to a remote service. Now, the call to the remote service generally returns something, but might also include input parameters. Suppose that an implementing class will typically only implement one service method. Given the above information, is the following a poor...

Java or C# library for signal analysis on the sound card

Is there any Java or C# library for signal analysis using the sound card of a PC? I'm not interested in music mixing, rather in general purpose signal analysis - take a look at SIGVIEW - I'm interested in a Java or C# library that can do that. Another example is the scEEG project, striving to build a sound card electroencephalograph, by...

Sun's Java SSL Implementation is Leaking Memory?

Hello everyone, I have a server component that I'm trying to load-test. All connections to the server use TLS 1.0. I have a simple test program that essentially does this on as many threads as I want: Full TLS handshake to the server send a request read reply close connection repeat ad nauseam My virtual machine is as follows: Java(...

What is weblogic.socket.Muxer?

Does any of you understand what weblogic.socket.Muxer is used for in WebLogic 8.1? Often in thread dumps I see stack traces similar to this: "ExecuteThread: '0' for queue: 'weblogic.socket.Muxer'" id=20 idx=0x68 tid=26709 prio=5 alive, in native, blocked, daemon -- Blocked trying to get lock: java/lang/String@0x2b673d373c50[fat loc...

Why my @singleton doesn't work?

Hi, I met a problem when trying @Singleton of Guice: import com.google.inject.Singleton; @Singleton public class ConfigManager { private String data; public void setData(String data) { this.data = data; } public String getData(){ return this.data; } public static void main(String[] args){ Confi...

Handle InvalidItemStateException in jackrabbit

We are now experiencing a number of InvalidItemStateException in our web application caused by 2 or more users updating the same content. As far as I understood it is in design of JackRabbit to throw javax.jcr.InvalidItemStateException in such situation and that's ok, but I wanted to ask about the common way to handle that. We are fairly...

Best practices in modelling user constraints in a webapp?

I'm building a webapp with role based access control using Acegi (Spring) security. So i have different users with roles: ROLE_ADMIN, ROLE_USER and etc. However, i need to implement various user constraints. Let's consider an example: Suppose, there is a site where users can watch movies online. There are users with roles ROLE_STA...

Problem Connecting to Secure Server in Java

Hi, I am trying to connect to a secure server using Apache Commons HttpClient 3.1. The problem is everytime the application connects it throws a "sun.security.validator.ValidatorException". Heres the stacktrace: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.c...

Signing message with certificate: JCE, IAIK or similar in IBM SDK 5.0

So, I'm in a very difficult problem. Using Java: I've an enterprise certificate (in .p12 format) altogether with its public key ("password" string). Also I've a text message which I've to sign in PKCS7 format. I've been reading a lot and I've realized that there's no STANDARD implementation to do what I want to do. There is the JCE/JCA...

singletons and threads

My question is about threads being queued. For my example I have one Spring context. I have a method named CalculateTax in a stateless class. A request comes in, a thread is created (tA) and it eventually enters the CalculateTax method. Within the same "time frame" another request comes in and another thread is created (tB). Now, here is...

How do I use an enum parameter in struts 2?

I'm trying to get an Action in Struts 2 to work with an Enum as an input parameter. What I've done so far looks like: public TestAction { public enum Module { VALUE1; } private Module module; public void setModule(Module module) { this.module = module; } public Module getModule() { return module; } } But wh...

Why is not possible to extend annotations in Java?

I don't understand why there is no inheritance in Java annotations, just as Java classes. I think it would be very useful. For example: I want to know if a given annotation is a validator. With inheritance, I could reflexively navigate through superclasses to know if this annotation extends a ValidatorAnnotation. Otherwise, how can I ac...

How to maintain application geometry, size (including child widgets') through sessions

I am writing a small application in GTK+ and java, and I want it to maintain its position, size, including those of child widgets, for each session. Is there any other way instead of manually storing size of each child widgets, and recovering them at startup? ...

Nexus and LDAP - JNDI-Problem while authenticating users against OpenLDAP Server

I am using Nexus repository manager (nexus.sonatype.org) with the open source LDAP plugin (code.google.com/p/nexus-ldap/) and I get an error indicating that the wrong protocol version is used (details below). All the plugin does is using the JNDI LDAP service provider to connect to my LDAP Server. If you look at the stack trace in the ne...

Why I get UnsupportedOperationException for this?

I am using a List to hold some data obtained by calling Array.asList() method. Then I am trying to remove an element using myList.Remove(int i) method. But while I try to do that I am getting an UnsupportedOperationException. What would be the reason for this? How should I resolve this problem? ...

Axis web service hangs because no connection-close is returned

I have a Axis 1.4 (with Spring) web service client consuming a PHP web service (running on Apache). This works perfectly in the development environment, but in the production environment the code execution hangs somewhere in the Axis library directly after the client has received the SOAP response. I have identified with Wireshark that t...

Does NHibernate interoperate with Hibernate? If not is there a framework out there for both Java and .NET?

Say you had: a database a bunch of .NET Windows GUI programs a bunch of Java web applications you could use Hibernate for the Java stuff and NHibernate for the .NET stuff - but would the two actually interoperate or would they be entirely different stacks? If not then is there a persistence framework out there that lets Java and .NE...

Design for using a mock connection

I have a simple application with a UI with a backend connection, from which i get the data. Now, during development, I wouldn't like to connect to the backend as it slows me down. So, i have some locally stored data and i 'mock' the connection to return the locally stored data instead of making a server call. Now, this is not for writin...

Developing JNI applications with Eclipse (Combined Java/C++)

Hello. Have anyone successfully managed to setup a combined Java/C++ project for Eclipse? What I am trying to do is quite simple; 1) Compile my Java sources 2) Run Javah to create the JNI interface 3) Compile all the C/C++ sources 4) Link native shared library + package the JAR Hints or even real projects which work are much welcome....