How can I set the java.library.path for a whole Eclipse Project? I'm using a Java library that relies on OS specific files and need to find a .dll/.so/.jnilib. But the Application always exits with an error message that those files are not found on the library path.
I would like to configure this whole project to use the library path. ...
We have the following legacy 2.0.7 Spring code:
final Map<String, MyClass> secondaryFactories
= (Map<String, MyClass>) context.getBeansOfType(MyClass.class,
false, true);
return (MyClass) context.getBean("myClass");
where context is an instance of
org.springframework.contex...
Hi,
I'm working on an application that processes audio data.
I'm using java (I've added MP3SPI, Jlayer, and Tritonus). I'm extracting the audio data from a .wav file to a byte array. The audio data samples I'm working with are 16 bits stereo.
According to what I've read the format for one sample is:
AABBCCDD
where AABB represents l...
Bear with me as I try to simplify my issue as much as possible.
I am creating a new ORM object. This object has an auto generated primary key which is created on the database using as an identity. Within this object, is a child object with a many to one relationship with the parent object. One of the attributes I need to set to create t...
here is my code:
Comic[] comix = new Comic[3];
comix[0] = new Comic("The Amazing Spider-man","A-1","Very Fine",9240.00F);
comix[0].setPrice((Float)quality.get(comix[0].condition));
for(int i=0;i<comix.length;i++){
System.out.println("Title: " + comix[i].title);
}
Why am I getting a NullPointerException when this code run...
That is, if I have "English (United States)" I'd like to get "en-US", or an appropriate java.util.Locale. It looks like the API is a one-way street, but perhaps I'm not looking in the right place. Thanks in advance.
...
Hi all, I need a sanity check on my strategy to best fulfill the requirements of a project. Basically I have an xml file that will need to be parsed periodically and html output displayed (xslt is not an option).
My thought is that I can use a single .jsp page to check an application variable that stores the last parsed date to know if ...
I want to port some existing j2se libraries (e.g. Apache Compression libs) to use for Blackberry development, but there is a catch (and not just one).
First, most java libs extensively use j2se collections and data types that are typically missing on j2me platforms — but that's theoretically solvable thanks to open-source j2se api imple...
I am facing an issue while consuming a java web service from .NET. I am able to provide the input to the web serive but not able to get back the result. The result is a custom object which is created in Java with one long, one short and one string variable. But the output I am getting from .NET is that long and short are always defaulted...
Hi, I'm creating a test platform for a protocol project based on Apache MINA. In MINA when you receive packets the messageReceived() method gets an Object. Ideally I'd like to use a JUnit method assertClass(), however it doesn't exist. I'm playing around trying to work out what is the closest I can get. I'm trying to find something simil...
I'm considering the use of JiBX for a project that will have to run on both Blackberry and RIM. While it seems like J2ME use of JiBX has been considered by the community (as per JiBX jira tickets), Android is relatively new.
The question is, therefore, this: has anybody had any success (or issues, for that matter) using JiBX on Android,...
First I'll provide a tiny code snippet here:
String path = "".equals(url.getPath()) ? "/" : url.getPath();
java.io.File f = new java.io.File(path);
if (!f.exists()) {
this.code = 404; // http Not Found
return;
}
Here, the URL's type is java.net.URL,and its value has this format:
file:///directory1/directory2.../filename
t...
I read this post, but I don't understand how I can gain access to the request using a ThreadLocal or DataSourceLookup or AbstractRoutingDataSource. I read every post but it still doesn't work.
How do I gain access to my request's dataSource parameters and dynamically create connections with them?
...
ok, im working in a j2ee project that has 2 branches in the repo and i'm ordered to mix them.
i was coding and then netbeans ask me "unreported exception blah bla bla must be caugth or declared to be thrown" and gives me the choice of just handle each exception or just throw it hoping someone else catches.
The classes i'm working with ...
I am quite new to java, and I would like to learn java just like python, with the interactive shell IPython.
I try a few a them, like beanshell, jython, jythonconsole, JyConsole... Almost all of them don't have the function of tab completion like ipython. Is there anything similar to that? Thank you.
...
What I would like to do is have a loop that names a certain number of variables each time. So sometimes when I run the program, this loop will create say 3 variables a1, a2 & a3 but other times it could name more, e.g. (if this sort of thing were possible):
for(int i=1; i<=n;i++) {
int ai = i;
}
So in the case (for i=1) the name o...
I've run through the Google Web Toolkit StockWatcher Tutorial using Eclipse and the Google Plugin, and I'm attempting to make some basic changes to it so I can better understand the RPC framework.
I've modified the "getStocks" method on the StockServiceImpl server-side class so that it returns an array of Stock objects instead of String...
I put "stax-utils.jar" in the extensions directory ([JAVA_HOME]/jre/lib/ext), but ant's java task can't find it, giving:
java.lang.NoClassDefFoundError: javanet/staxutils/IndentingXMLStreamWriter
Strangely, it works for compilation: ant's javac task can find it. The problem is only with running code, with ant's java task...
If I us...
Hello everybody.
I am writing a website using JSP, JSTL, Servlets and JavaBeans.
At one point of my code, I am trying to use an ArrayList of objects, and a strange thing is happening: when I add the first object it is fine, and when I add a second object it adds it in the second place, but the object at index(0) gets the same values as...
I am a newbie in the area of AOP. The first time I coded something applying concepts of AOP, I was thrilled to understand how aspects eliminate cross cutting patterns in your application. I was overwhelmed by the thought of solving cross cutting patterns like security, logging, transactions, auditing and etc applying AOP.
However, when ...