John Low

Greenhorn
+ Follow
since Mar 24, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by John Low

hi folks,
i have an rmi server running which extends UnicastRemoteObject and upon startup, before any clients have connected, it spawns about 15 processes, 1 parent and 14 children. the same thing happens when i start the rmiregistry (1 parent, 12 children). i'm running on suse 9.0 using jdk 1.4.1_06.

i don't believe i've seen this sort of behavior before and don't know what all these additional processes are being spawned for.

is there a good reason why these extra processes are being spawned? is there any way to constrain the number of processes that are spawned for a java app?

thanks for your help.

cheers
19 years ago
hi folks,
i'm running into a frustrating issue with my webapp. i'm using tomcat 4.1, tiles and struts. during startup, the application is to initialize a few things including application properties. one of my classes contains a member Properties which is to be populated during initialization with the file from disk. however, if the Properties is a member and not declared in the method, i get an AllocateException. in addition, when i try to getInstance() of my cms and assign it to a member variable of a singleton class of the webapp, i get the same exception... for example:

either of the above two assignments will cause an AllocateException. i can't fathom why this would not work.
on the other hand this will work (but is useless for me in the context of having a singleton class...):

any ideas? thanks!
20 years ago
i am parsing a simple xml document using dom and attempting to display the data in a JTree which will eliminate and group the node data together at the parent node level.
the basis for my code is from the java tutorial http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/ with the following modifications to the AdapterNode toString() method:

my xml document has the following basic structure:

the JTree looks like this:

so, given a [group] node which must have [name] and [id] children and optionally a [groups] node for further nesting. however, since the level of detail shown in the JTree is unnecessary for me (all i want is the [group] entry with the nodeValues of it's children who are not a node of name [groups]). so ideally, my JTree should look like:

etc...
the problem is that when i take the parent node ([group]) and getChildNodes(), i can invoke on a node of that list, node.getNodeName() and it will return the proper name of the node. however, if i invoke node.getNodeValue() on the same parent, it returns a null value, despite the fact that when you expand the JTree, the specified nodes and values are present.
sorry for the long message. any ideas anyone?
hello all,
i'm having some trouble updating my JTables properly. i have 3 JTabbedPanes, two of which have JFrames which contain JTables, each of which uses a subclass of AbstractTableModel to represent the data models.
the gui subscribes to a jms topic and, upon consumption of a message, processes and propagates the changes required by the content of the message. on the first message after client startup, it behaves as it should, but subsequently fails--e.g. if i insert a row into one of the tables, the data is displayed, however, the table.getSelectedRow() _always_ returns -1.
here is some of the update code:

first i extract the message payload and then based on that information the clients whose users are a member of the list of assignees will have their guis updated. for each notifiee of this message i generate a new tableModel since the existing model is no longer valid (i.e. messages only arrive upon modification of the server's data model by a client). then, based on the new tableModel that i have, i invoke generateTable(TableModel) to generate JTable based on the tableModel passed. i then set the JTable belonging to each subclass of JFrame in each JTabbedPane to the generated JTable.
a version of this code did work at some point before, but i've lost it and can't recall how i did it...
any help is greatly appreciated!
thanks
21 years ago
owing to a number of stupid errors on my part(like forgetting about the html:form tag...) things now work. i've used a variation of your scriptlet (w/o the original idea of looping through 2 collections) and everything is just peachy.
thanks for all your help!
21 years ago
that's the bizarre thing--there is no stack trace, just the html page partly generated... (it's just the page it's supposed to display, stopped in the middle of my javascript function--it has nothing to do with the actual javascript function though, since removal of the offending "logic" code allows normal loading of the entire page). i am pretty sure that the problem has to do with the opening logic tag, but don't know what is wrong...
on a side note, is it ok to get/set session attributes from the Action servlet which are used globally in the app?
let me know if there's any other code you'd like to see.
21 years ago
you are correct--the getter is called getSize(). i changed the property to getSize() but now i get the white screen regardless of the size of the batch group... i've tried the "present/notPresent, empty/notEmpty" tags also, but they result in the same partial page too.
very confused...
21 years ago
ok, it seems like either way i do it, for some reason the jsp page actually stops loading mid-page and i get a white screen. currently, i'm trying this:

the batchGroup object is declared at the top of the page like: <jsp:useBean id="batchGroup" scope="session" class="com.xxx.xxx.BatchGroup" />.
the batchGroup object is initially instantiated in an initializer servlet which sets the object to the session (session.setAttribute("batchGroup", batchGroup). in the jsp page to which control is redirected by the init servlet, i refer to the declared jsp bean within my scriptlets without getting the attribute from the session (i am assuming that the jsp:useBean declaration takes care of that).
if i remove the "<logic>" tag code, all looks fine, until the batch group size is larger than 0. then i get the white page. if i remove the code altogether, the page loads fine (albeit w/o what i'm trying to accomplish with the logic tags).
any ideas why it's crashing?
thanks!
21 years ago
hello all,
i want to check whether a collection in my bean is empty, if not, i want to present a form which contains some text which is extracted from the bean. there are 2 distinct collections, all the elements of which i want to print out like "groupname: jobname" (w/o the quotes).
the following is how i think it should work (but it doesn't...):

any ideas as how i can accomplish this?
thanks!
21 years ago
i totally screwed up. since the container was not spitting out any "file not found"/io errors, i didn't realize that it could not find my properties file!
thanks so much for your help--much appreciated and helpful. i have another question, but i will post it in a new thread so people won't be deceived by the subject line... if you could take a look at that, it would be great.
thanks again.
21 years ago
in that case, the ActionServlet will only generate this error in the case that a java.lang.Exception is thrown in the Action class? all i'm trying to do is present and record a submission error... i assume that the java.lang.Exception has no place in my mapping then... is that correct?
thanks for your help!
21 years ago
i excluded the logging message from my post, but it's within the validate method like:

my struts config maps this error like this:
<exception key="error.predefinedJob.groupname.required" type="java.lang.Exception" path="/pages/predefinedJob.jsp" />
from the documentation, i'm uncertain about the use of "type" in this since an error is what i specify as an error, no? is it correct to assume that the path should simply be the actual uri of the jsp or am i thinking about this incorrectly?
thanks!
21 years ago
many thanks! works as expected now.
another (unrelated) question i have is regarding my error messages. my ActionForm subclass generates errors within the validate() method like this:

my jsp page simply references the ActionErrors like: <html:errors/>
however, this fails to print any messages to the jsp page despite log messages which confirm that the validation of the data failed. the application.properties file contains a key which matches the string in the ActionError so i'm not sure why this may be happening...
thanks in advance for your help!
regards
[ March 25, 2003: Message edited by: John Low ]
21 years ago
i am creating an html select pull-down menu based on collections i obtain from my bean. however, every single one of the option values it prints out has a default of selected="selected" which is totally unacceptable. this causes the _last_ item in the collection to be "selected" by default instead of the first hard-coded item "select", thus forcing the user to scroll _UP_ rather than the down.
the code is as follows:

the output is something like this:
<option value="select" selected>SELECT A GROUP</option>
<option value="CHEYETTE_TESTING_PP" selected="selected">CHEYETTE_TESTING_PP</option>
<option value="LON_PP_ALLStruct" selected="selected">LON_PP_ALLStruct</option>
... so on and so forth
any ideas as to how i can get rid of those defaults being automatically inserted into my option tags?
thanks,
john
[ March 24, 2003: Message edited by: John Low ]
21 years ago