java

Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object

Hi Friends, I am new to RMI technology. When I am running the rmi client program, I am getting the exception : java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object. I am using jdk1.5 The argument of the remote method is the Serialized object. These are the server code... This is the Remote Inte...

Java Message-Driven Bean does not use security settings when calling secured web service

Hi, Using Websphere 6.1, I'm attempting to call a secured web service (using a custom authentication token) from a message-driven bean. However, the call repeatedly fails because the required token is not added to the SOAP message being sent. The settings to call the relevant TokenGenerator are specified in the deployment descriptor of ...

Preprocessing with Javacc/ push front some chars in the stream ?

Hi all, Using javacc can I push some new characters in front of the inputstream ? for example let's say that my parser parses the following syntax: #define Paragraphs "Paragraph+" #define Volume "(Title,(Chapter,${Paragraphs})+)" Book=${Volume}+; How can I tell javacc that its scanner should preprocess ${Volume} to (Title,(Chapter...

Libs for HTML sanitizing

I'm looking for a html sanitizer which I can call per API to sanitise strings which I get from my webapp. Are there some useful easy to use libs available? Does anyone knows maybe one or two? I don't need something big it just must be able to find unclosed tags and close them. ...

Is there a simple way of obtaining all object instances of a specific class in Java

Currently I am working on a Java agent to assemble memory stats. With the help of the instrumentation API I can get a hold of the classes (and manipulate them). With plain Java I can get an estimate of the resources used for each object. So far, so good. The question I am faced with right now is "how to get a hold of every Object instan...

How do I get started using Java for web development?

OK, here's the easiest question for the day for those of you who have ever done this. I'm learning Java and I heard that Java can be used to build websites. I am coming from a PHP background, so I would really appreciate using a strongly-typed well-designed language like Java for web development. However, either I can't get my search key...

Streaming videos from mobile phones.

I'm searching for open source libs for Streaming videos from mobile phones (from cameras on mobile phones) to servers. JAVA or C/C++ any one knows any? ...

Registering a URL protocol handler in a multiple platforms.

I an wanting to create a Java application that is installed on multiple platforms (Windows,Mac OS, Linux) as a part of this install I wish to register a URL protocol handler, so that my app loads when links are clicked. i.e. I want something like this: myprotocol://example.com Is there any sort of consolidated way of doing this? Or som...

Actionscript class not found at runtime for BlazeDS communication

We are using GraniteDS autogenerated AS code to map Java remote objects to AS. We have objects that contain List sites in Java so when they are converted to AS it looks like: JAVA: private List<MyObject> territories; Actionscript: private var _territories:ListCollectionView; The trouble is we are using MXML databinding to...

JPA setParameter when dealing with "NOT IN (:param)"

Hi all, I'm trying to set a parameter in my query, for example: select * from Cars where Cars.color NOT IN (:color_params) And when I'm adding the parameter in my JavaClass is like: ... query.setParameter("color_params", "RED,BLUE"); ... And this is not working, is only working with only one parameter. I've tried with "'RED','BL...

Java HTMLUnit MalformedURLException

Hello, I'm trying to execute this code from the HTMLUnit tutorial: final WebClient webClient = new WebClient(); final HtmlPage page = webClient.getPage("http://htmlunit.sourceforge.net"); but I get the MalformedURLException in the second line when saving it in Eclipse (if I compile and run the code, I get it too). What's the problem? ...

JBoss 5 cluster as JMS server durable problem

Hi! I have an pair of JBoss 5.1 servers clustered together to act as an fault-tolerant JMS server. I configured them to use MySQL datastore (with clustering setting enabled in mysql-persistence-service.xml), I created an topic mbean in destinations-service.xml by defining: <mbean code="org.jboss.jms.server.destination.TopicService"...

How does Wicket's @SpringBean annotation work?

How does Wicket's @SpringBean annotation work? Does it use reflection at run time? Does it make the compiler inject some code? Or what? ...

Ant task that processes multiple files

Hi, in Ant I want to execute a Java task on a fileset. I use the Java task to run rhino which runs a JS beautifier. The later works without any problems, except that it might seem little bit awkward to use rhino+js to acutally have a working JS beautifier/indenter. But all working JS beautifiers I have found are all written in JavaScript...

Authentication based on Certificates and IP

Is there a way for a java web app to get information on the security certificates installed on one's machine via a http request and selectively grant access if a particular certifiicate is installed on the machine. Basically the requirement is, the web application should entertain request only from a company laptop else must deny acces...

Passing Credientials through WCF to Java WS

I have a WCF entrance that communicates with an internal java WS for our client. Now have to expand this WCF to be multi app and pass to the java WS the proper certificates. Currently the one was part of the bizObj class in my WCF. I have multiple .cer files that I will have to maintain in my WCF and pass in by caller app. Of cour...

spring - hibernate load *.hbm.xml from classpath resource

I have some hbm.xml files in classpath resource located in src/main/resources maven's folder. I used spring's LocalSessionFactoryBean to load these files with the following bean config: <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSourceOracl...

Why access to filed and method differs in inherited class in Java?

class BaseClass { protected int filed = 1; public void method() { System.out.println("+ BaseClass method"); } } class DerivedClass extends BaseClass { private int filed = 2; public void method() { System.out.println("+ DerivedClass method"); } public void accessFiled() { System.out.p...

Getting the Return Value from JDBC MSSQL

I'm connecting to SQL Server (2005) through Java using the Microsoft SQL Server JDBC Driver 2.0. How do I get the return value from a stored procedure? I'm doing something like: Connection connection = dataSource.getConnection() CallableStatement proc = connection.prepareCall("{ call dbo.mySproc() }"); proc.execute(); Should I be us...

Java Swing design

Hello, I have a question regarding coding a Swing UI. If I want to make a software with some option e.g. on the first Frame I have three buttons (New, Option, Exit). Now if a user clicks the new button, I want to change the entire content in the Frame to something else. I know I have to use addActionListener to that button. But my quest...