I'm trying to debug a file descriptor leak in a Java webapp running in Jetty 7.0.1 on Linux.
The app had been happily running for a month or so when requests started to fail due to too many open files, and Jetty had to be restarted.
java.io.IOException: Cannot run program [external program]: java.io.IOException: error=24, Too many open...
whenever they say run a .class file in JVM. do they mean with the command "java" in the terminal.
or can you click on it to open it?
...
I'm trying to write my own "functional" little lib in Java. If I have this function :
public static <T> List<T> filter(Iterable<T> source,BooleanTest predicate)
{
List<T> results = new ArrayList<T>();
for(T t : source)
{
if(predicate.ok(t))
results.add(t);
}
return results;
}
why can't I use it...
I need to generate a number of XML documents from Java objects. The objects are deep ORM mapped objects, and the XML documents are for a search index (a la Lucene). I want to be able to create a configuration file and feed it a Java object and have it spit out the XML specified in the configuration. Ideally the configuration would con...
I'm interested in writing a visualization program for the road data in the 2009 Tiger/Line Shapefiles. I'd like to draw the line data to display all the roads for my county.
The ESRI Shapefile or simply a
shapefile is a popular geospatial
vector data format for geographic
information systems software. It is
developed and reg...
Hi,
I have the following controller
@Controller
@RequestMapping("/project/view.html")
public class ProjectViewController {
private static final String viewName = "projectView";
@RequestMapping(method = RequestMethod.GET)
public String showPage(Model model,
@RequestParam(value="id",required=false) Long id) {
//code.....
...
I am deploying an EAR file to the IBM WebSpehre server 6.1 - I want to be able to access the EAR application name which is stored in the deployment file under 'display-name'. Looking through stack overflow posts on related subjects, I've been able to gather that this is possible via the Java MBean API - or IBM's WAS API - Problem is I c...
I need my app to run on all Android versions, but the Contacts API changed in 2.0.
In SDK 1.6 and earlier I use android.provider.Contacts to query the contacts DB, but this does not work in 2.0
Instead, for 2.0 I use android.provider.ContactsContract. This presents a problem: when I have code for ContactsContract, my app will not build...
I have started using Guice to do some dependency injection on a project, primarily because I need to inject mocks (using JMock currently) a layer away from the unit test, which makes manual injection very awkward.
My question is what is the best approach for introducing a mock? What I currently have is to make a new module in the unit t...
Confused as to building a java spring/mvc web app.
When you use netbeans or eclipse, do you have to use the maven/ant build script?
if you don't use maven/ant, how does netbeans/eclipse perform the build then?
...
Likely a dumb question but..
Are there any good guidelines for how much memory basic Java data structures will consume?
Ie: How much memory will be consumed by a simple POJO with an int member and a String member (say that holds a 10 char String)? How much memory would be consumed by a List of 10 of said objects?
etc
...
In your service layer, say you have a method that does XX, is this how you would reference your Dao classes?
public class SomeServiceImpl implements SomeService
public void DoSomething(int someThingId){
UserDao userDao = this.daoFactory().GetUserDao();
SalesDao salesDao = this.daoFactory().GetSalesDao();
..
..
...
I have a simple method that returns bool, but it internally loads various objects.
I check for null for each, but it becomes very ugly.
Is there a better way?
public bool SomeTest(int id1)
{
bool result = false;
User user = userDao.GetById(id1);
if(user != null)
{
Blah blah = blahDao.GetById(user.BlahId);
if...
I have an XML document (generated by Adobe XFA forms), that contains data like the following:
<Position>
<PositionBorder>
<Title/>
<StartDate/>
<EndDate/>
</PositionBorder>
</Position>
Since this file is defined elsewhere, I am not at liberty to change the format of the XML that I get.
In my Java code, I cr...
I'm working on something that might benefit from a pattern like the following:
public abstract class SomeBuisnessThingy()
{
protected int someDatapoint;
}
public class ADatabaseThingy() extends SomeBusinessThingy()
{
@SomeJPAAnnotation
???? someDatapoint;
}
public class AWebServiceThingy() extends SomeBusinessThingy()
{
@SomeS...
hi everyone
I have what I thought was a simple Spring MVC app. However, I can seem to set the requestMappings correctly. What's strange is that the logs show that the url is mapped to the proper controller, yet the Dispatcher cant seem to find it at runtime. Any suggestions would be much appreciated:
Log
INFO: Mapped URL path [/app...
Hey guys, I have an interesting one for you here!
I have one object, called Server, that implements two RMI interfaces, CSCP and ISCP.
I need my Clients to be able to communicate on the RMI CSCP interface, but know nothing of the ISCP interface, and I need other servers to communicate with it on the ISCP interface but know nothing of th...
hi,
i have an arraylist of objects, each containing a year/month/day/hour property. what i'm ultimately trying to do, is create a new multidimensional array that contains a group of every object by incrementing hour. so for instance, an example of the final array i'd want is:
array: [0]
[0] 01:04:00, 4-10-09
[...
I have html that has the weight of a item.
<div><b>Item Weight (0.51 lbs in Warehouse 3)</b></div>
I need a regex to get the weight and unit of measure.
So in the above html, I need:
0.51
and
lbs
I am using java, I have a helper method, just need to get the regex down now!
String regexPattern = "";
String result = "";
Patte...
I have Jboss 4.0.4GA setup in Linux. after I start my jboss without problem, I tried to access JSP page in browser, got error:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or
try again later.
A name was started with an inva...