java

Is it likely appdomains will help in this scenario?

I have a dotnet process that through calls to an unmanaged dll is communicating with a Java process. Under some circumstances, the Java process appears to be crashing and taking my dotnet process down with it. No exceptions are raised, the process just dies. Upon crashing, java is creating a log file with names like "hs_err_pid3228" e...

Running a Java Program

Howdy. I looked at some other SO questions, didn't find anything that solved my problem... I have a Main.java file (below) and a OthelloLib.jar file without associated source files. Running javac Main.java fails with Main.java:8: cannot find symbol symbol : class SimplePlayer location: class Main OthelloPlayer p1 = new Simple...

java read text from image file

what is the best open source java library that i can use to extract text from image (jpg,png) files? ...

Which design pattern should I use for a TODO list in Java?

Which design pattern should I use for a very simple Object-oriented todo list? Initially I started off with classes for Task, TaskList, Driver. Also a simple UI displaying a list of the Task titles. I was struggling to have the UI update the list when new tasks were added, and in trying to solve this I realised my whole layout was proba...

how to use multiple threads to process large number of files stored in the local disk ( using file lock)

how to use multiple threads in java to process large number of files stored in the local disk directory ( using file lock) ...

File Download Servlet

How should I implement very basic file download servlet? Idea is that with GET request index.jsp?filename=file.txt user could download for example file.txt from file servlet and file servlet would upload that file to user. I can get file, but how should I implement file download? ...

Struts 2 Select tag

I'm pretty new to the jsp and struts way of doing things and so far I like what I see. My current question is with the use of the struts select tag. I have a page that displays a number of dropdown boxes using struts select currently the options are hard coded in the jsp. I would like to populate them based on a properties file. Howeve...

Can I invoke XMPPConnection.sendPacket from concurrent threads ?

Motivation I want extra eyes to confirm that I am able to call this method XMPPConnection.sendPacket( Packet ) concurrently. For my current code, I am invoking a List of Callables (max 3) in a serial fashion. Each Callable sends/receives XMPP packets on the one piece of XMPPConnection. I plan to parallelize these Callables by spinning ...

What cool frameworks are there on Java/Ruby etc. that don't exist on .NET?

I was just reading a post from Justin Etheredge in which he wrote "... I get so jealous when I talk to the Java guys at work and see all of the freaking awesome tools that they have for free on their platform. Since I use the NUnit, NCover, NHibernate, NAnt stack when doing most .NET development, sometimes I feel like we are just a bunch...

Java double initialization

In what way are these statements different? double dummy = 0; double dummy = 0.0; double dummy = 0.0d; double dummy = 0.0D; ...

Jumping between XML tags

Hi, This is a doubt in SAX. I want to process the children tags in a XML file,only if it matches the parent tag. For ex: <version> <parent tag-1> <tag 1> <tag 2> </parent tag-1 > <parent tag-2> <tag 1> <tag 2> </parent tag-2> </version> In the above code, I want to match the parent tag f...

Java Date Format that allows - / or . as separators within date

What's the nicest way to parse a date that can be in one of the following formats "dd-MM-yyyy HH:mm" "dd/MM/yyyy HH:mm" "dd.MM.yyyy HH:mm" without creating 3 SimpleDateFormats and parsing against each one. Thanks ...

Can't filter filenames in Talend Open Studio using regular expressions

Hi to all! This question is about Talend Open Studio code. I use tSendmail component as a child job, that needs to be run when parent job fails (tFtpPut). However, in tFtpPut, file names are filtered by filename masks (for example, it will upload file named Eedoh, if I put Ee* as a mask), but in tSendMail that's not the case. I unders...

Hibernate template close transaction

I have next working code: Session session = null; try { SessionFactory sessionFactory = new Configuration().configure() .buildSessionFactory(); session = sessionFactory.openSession(); String id = (String) FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap().get( "storeId"); Transac...

Package not found in maven jetty plugin

When i try to run jetty maven plugin(mvn jetty:run) I have received this error: [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure D:\projects\Projekt\src\main\java\Runner.java:[18,22] package org.apache.uima does not exist This package use class Runner, an...

Accessing member variables of other object of same class in Ruby

In Java I can do: public boolean equals(Object other) { return this.aPrivateVariable == ((MyClass)other).aPrivateVariable; } This allows me to define equality without breaking the encapsulation of my class. How can I do the same in Ruby? Thanks. ...

@Secured throws AccessDeniedException although roles are correct

After solving all authentication related problems in my first Spring web application I'm now stuck with authorization. Configuration using @Secured annotations is pretty straight-forward so I don't think I made a mistake here. Additionally I'm using an Active Directory using the LDAP authentication provider and assign roles by AD groups...

What impact, if any, does the -d64 swtich have on Sun JVM resident memory usage?

I've got this webapp that needs some memory tuning. While I'm already profiling the application itself and trimming things down, the JVM itself seems overly bloated to me on our busiest instance. (The lower volume instances do not have this problem.) The details: Platform: RHEL4 64-bit (Linux 2.6.9-78.0.5.ELsmp #1 SMP x86_64) Sun J...

How to restrict the memory usage of Java application packed in a jar (-Xmx doesn't seem to work) on Windows

Hi, I'd want to restrict the maximum heap size for a Java application but it doesn't seem to work. I'm running the application from a jar package through bat in Windows. Bat contents: @Echo off set CLASSPATH=. java -Xmx32m -classpath %CLASSPATH% -jar MyApplication.jar This should restrict the maximum heap size of 32 megabytes. Howeve...

JAXB: element is named after type, not property

Web service wsdl contains following schema: <xs:complexType name="DocumentSearchInfo"> <xs:sequence> ... <xs:element minOccurs="0" name="Industries" nillable="true" type="tns:ListCondition"> <xs:annotation> <xs:appinfo> <DefaultValue EmitDefaultValue="false" xmlns="http://schemas.microsoft.c...