java

WCF Service with .NET 2.0 and Java Clients

Hello, My WCF Service is complete with .NET 3.5 and I used wsHttpBinding while implementing my service. For .NET 3.5 clients, there were no problems, but .NET 2.0 and Java Clients had issues in wsHttpBinding. So I added a new endpoint with basicHttpBinding with similar security as wsHttpBinding with following criteria in mind: I wou...

web services/object-oriented question

Hi, I just recently started with object oriented programming, using java. Before I was programming in old visual basic which wasn't object oriented and in old php which wasn't object oriented .. Now my question : Where can I learn about webservices and object oriented programming through concrete examples? (real life examples not hello...

How to test with easymock Capture

I have the following code Record rd = registerNewRecord(); <do some processing> rd.setFinished(true); updateRecord(rd); The registerNewRecord method calls the RecordDao insert method, and updateRecord calls the update method on the same DAO. I have the following easymock code: Capture<Record> insertRc = new Capture<Record>(); Record...

trouble with JNDI Data Source in Tomcat

Hi, I've been having a hard time making a JNDI data source work. Following instructions at http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html I'm connecting to oracle with Tomcat5.5 I can connect fine if I use straight JDBC connection in code. Here is what I have: in my META-INF/context.xml: <Resource name="jdbc/mydb...

How to deal with VARRAYs (Oracle 9i) in JDBC ?

Hi, I am trying to write a small program which has to store and retrieve values from database. The database is object relational. Here're the DDL statements : create or replace type Guy as object (name varchar(80), address varchar(80), dateOfBirth date) create or replace type KnownLanguages as varray(10) of varchar(80) create table ...

Is there something like asynchronous caching with ehcache and springmodules?

Is it possible to have cached queries asynchronous, so that no frontend user actually has to wait for a heavy query to finish? (I.e. heavy query is running as background thread, while (expired) data is delivered from cache. Use case: A web page displaying data, needing some time (too long to wait for when requesting a page) to be collec...

Java, ASM org.objectweb.asm.util.CheckClassAdapter causes Unsupported major.minor version 0.0

Hello! I am getting following exception: java.lang.UnsupportedClassVersionError: net/sourceforge/barbecue/BarcodeException : **Unsupported major.minor version 0.0** at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.defineClass(ClassLoader...

how to call a web service (described by a wsdl) from java

Knowing nothing of web services, I'm just trying to call some "isAlive" service that is described by a wsdl. This seems to me like something that should take more then 2-5 lines of code but I can't seem to find anything but huge long examples involving 3rd party packages etc. anyone has any ideas? If it is always suppose to be long mayb...

Phone number validation using VOIP/SIP

The task is to validate an US phone number. Checking format of the number is not enough. So I should make a call to the number and determine if the subscriber answers. Is it possible to automate it using VOIP solutions? Please, suggest any ideas to start with. I'm going to implement it on Windows platform (probably .NET or Java). It c...

Websphere - What is the best way to hide wsdl's from end user?

Hi all, I think there are several ways to hide wsdl's from end users for WebSphere (6.1). We use axis to publish Web Services and I currently updated the custom Servlet class (which extends AxisServlet) and override the service method to throw 404 error for urls like: http://xxxx/services/MyService?wsdl. The other option may be adding f...

JPA and InnoDB, and JSP/JSTL questions

A couple of questions: If I have mapped a Customer with an i-var List<Order> orders with annotation CascadeType.ALL, should I also set the relation in MySQL InnoDB ON DELETE CASCADE? Or will these interfer? Is it necessary to say <%@page contentType="text/html" pageEncoding="UTF-8"%> in every JSP file? Can I set this as a configuration...

HTTP Request (POST) field size limit & Request.BinaryRead in JSPs

Hi, First off my Java is beyond rusty and I've never done JSPs or servlets, but I'm trying to help someone else solve a problem. A form rendered by JavaScript is posting back to a JSP. Some of the fields in this form are over 100KB in size. However when the form field is being retrieved on the JSP side the value of the field is being t...

Java clob retrieval using getString - character encoding issue

Hi, So I have a database with a table, where one of it's entries is 'é€áí', and I know this is correct in the db. It is stored as a clob. In Java, I retrieve the entry like so: String text = resultSet.getString(DBConstants.COL_NOTE_TEXT); When debugging, text is equal to 'é\u0080áí' and when displayed on the screen the euro symbol i...

How to use Quartz with EJB3 ?

Hello everyone. I want to be able to : define different jobs and triggers. modify the expirations dates and intervals on demand pause or cancel an execution (trigger) the jobs would be ejbs or call ejbs and i would want to manage everything from the website (the user will have to define the executions) So i looked at the timerservi...

Round corners on images using Java and JAI

We're using JAI (https://jai-imageio.dev.java.net/) to scale and crop images in Java. We would like to create round corners on our images. How do we do that? The images are JPG and PNG. I would think it's easier to do this with JPGs? The image is a PlanarImage from JAI PlanarImage src = JAI.create(...,...); which can be transformed...

Busy graphic on a tab of a JTabbedPane

Hi, does anybody know of any open source implementation of a JTabbedPane in which I can set a busy graphic (say spinning ball) on the tab, while I load something into the tab - much like the spinner on Firefox tabs. I realize I could do this by hand by creating an animated GIF and setting it as an icon on the tab - but i was hoping that...

Encoding cp1252

When i try the following in java System.out.println(System.getProperty("file.encoding")); i get cp1252 as the encoding Is there a way to know where this value is coming from ? (Like Environment variables or something) I would like to print the value of encoding on command prompt using some command like systeminfo on windows xp. ...

What is the memory footprint of a method intensive Java object?

Suppose I have a Java class that has 100K worth of method code containing NO variables, but only 20 bytes of attributes. I instantiate 1000 objects from this class. Have I consumed 100,000K of memory? Or only 100K + (20bytes * 1000)? Or something else altogether? ...

How to scan remote host port that in used?

this is the code that i get so far... import java.net.*; public class PortScanner { public static void main(String args[]) { int startPortRange = 0; int stopPortRange = 0; startPortRange = Integer.parseInt(args[0]); stopPortRange = Integer.parseInt(args[1]); for (int i = startPortRange; i <= stopPortRang...

How to access CSS properties for a DOM node using the Cobra/Lobo HTML renderer

Hi, I am trying figure out how to access CSS properties for a DOM node (in this example <img> nodes) using the Cobra/Lobo toolkit. What I have at the moment is: UserAgentContext uacontext = new SimpleUserAgentContext(); DocumentBuilderImpl builder = new DocumentBuilderImpl(uacontext); URL url = new URL(TEST_URI); Input...