| Dangerous code up for peer review |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- improve J2EE performanceI have installed on my computer Sun J2EE server to use IMQ.
Normally after boot I digit :
./[path]/bin/asadmin start-domain domain1
but the performance aren't good , because I use an application with (more
or less) some hundreds msg/minute.
How Can I improve this server's performance ?
I can start this server on another runlevel or I can allocate to him more
resources ?
--
Ciao Flex
________________________________________________
Chi sa ascoltare non solo e' simpatico a tutti ,
ma prima o poi finisce con l'imparare qualcosa
- 2
- Problems in xml parsingHi,
I am using XMLTool.java to convert an xml file into an xml document
and
I am parsing the xml file using Nodelist and Nodes.
NodeList ls = getElementsByTagName("xxx").
Its working fine when I am running my application in windows.
But when I am running the same application in unix, I am getting
exceptions while parsing. Its giving null value and I cannot proceed
further.
Can anybody pls suggest where I am doing wrong?
I appreciate your help.
Regards,
Hari.
- 2
- Confused about referencing info stored in a JFrame
I've tried to develop several JFrame programs in the past and it
always drives me crazy because I can't figure out how to set Classes
I've developed, which aren't Components, but are critical to storing
information necessary for the program to operate, so that they can be
seen by components inside the frame. I'm not very knowledgable about
the structure and coding of Swing/AWT programs, but I understand the
princepals of passing data between methods and classes, and it is very
frustrating to me that I cannot find an easy way (or even a working
way at this point) to reference the info with my program the way I
need to.
To illustrate my question with a real example, I'm trying to write a
program which allows employees at my job to easily receive products
from deliveries by scanning the barcode on the product or putting in
the supplier code on the invoice.
The program needs to be able to extract product info from the database
(to match the scanned barcode and to give the receiver visual
verification that the info in the system is correct), and it needs to
be able to match the product with the vendor, and thus the vendor
codes, which go with the invoice.
I've connected my first draft/test program to the database using a
class I call dbInfo. This class stores the connection information
specific to our database, and also acts as a container/manager for
other classes which populate arraylists such as VendorList, BrandList,
and lists for any other info which is tied to a primary key in the
database and might change during the use of the program (this way in
the info in the form can be refreshed by simply using one dbInfo
method).
My dbInfo class populates all its info into the appropriate lists
correctly. I cannot, however, get my components to see this info.
For example, I have a VendorBox, which is a JComboBox that selects the
vendor for the invoice.
My original vendorBox grabbed its vendor information directly from the
database by storing its own JDBC info and generating the SQL statement
itself. This worked fine, but is not very modular, I had to add code
to every other component that dealt with this info which would to
reference the specific VendorBox on that JFrame form. If I could get
the components to see the dbInfo for the form, I could just store the
reference to VendorBox as dbInfo.invoiceVendor and any other component
could have easy access to it by simply knowing where dbInfo was.
Long explanations can be hard to read, so here's a basic diagram
------------------------------
JFrame
|
}Components
| }VendorBox ( a ComboBox which selects the
| vendor to receive from )
|
}dbInfo (not a component)
}VendorList
------------------------------
My Question: How to I get VendorBox to see VendorList (or dbInfo for
that matter)?
------------------------------
*Note: I'm using Netbeans 5.5, which doesn't allow me to edit the
component initialisation proccess inline. I think I might be able to
do this using the properties window, but I haven't had any luck
getting this to work*
What I've tried:
Just putting it in based on its name and location:
1) A direct reference - using a setdbInfo() method, which sets the
dbInfo equal to JFrameName.dbInfoVariableName. Netbeans gives me a
variable (or symbol or something of the like) not found.
2) The Netbeans property window - because I have setdbInfo() and
getdbInfo() fields in my VendorBox class, Netbeans shows dbInfo in the
property window. Trying to edit this property gives me a form which
among other things says 'form connection mode' and has options like
'from property' and 'from method'. None of the options have any
options to select within them, which I think is because i need to do
something to set up the form connections, but I'm not sure and my own
personal searches have not presented me with useful information.
At this point I thought I'd try to make a finddbInfo class, which
would just find the dbInfo class by crawling its way out
3) Introspection - When I read the description of this I sighed
relief, I thought it would show me the class that my VendorBox was
inside, but as far as I can tell it only shows you the class
inheritance information. I tried all the getxxx() commands netbeans
offered for code completion, but all I got back was info from the
classes my vendorBox was built on or null.
4) VendorBox.getParent() - combined with introspection, I used this to
progress a Class from displaying info about my vendorBox to info about
its containing panels, when I progressed to the outmost panel,
however, instead of getting the JFrame info on the next entry, I got
null.
At this point I cried, cut myself, and poured the rest of my drink out
for my dead homies.
Please help me, I enjoy using Java because I can work with it quickly,
but I feel like screaming sometimes because I can't pass a simple
piece of info to a component. I've learned so much more than I needed
to and wasted so much valuable time trying to do this and I know in my
heart that there is an easy answer that will make me feel
simultaneously stupid and relieved. I need that feeling like you
wouldn't believe, and I'm sure there our other amateur programers out
there who could benefit greatly by understanding why my methods don't
work.
On that note, if you could even explain why solutions like 1) or 4)
don't work, I think a lot of people could benefit from that info.
- 2
- doModalHello.
How can I open a JFrame as a modal dialog box ?
Thanks :)
- 4
- Latte Diablo JRE 1.3.1 binary package on FreeBSD4.7Hi All,
I was wondering if anyone else at Imeme has had any success with getting
JDK /usr/ports/java/jdk13 working on their jail.
Also if anyone on the freebsd-java list has any experience getting jdk13
working on FreeBSD 4.7 I would much appreciate any help.
The build command I am running in /usr/ports/java/jdk13 is
make build FORCE_PKG_REGISTER=1 WITHOUT_X11=1
I am not sure if I need (or if it does anything) the WITHOUT_X11=1 but I
know that we aren't running X11 and have used that on ports before so
thought I would try it.
make goes off and does a lot of stuff and ends with the following:
---------------------------------
gmake[3]: *** No rule to make target
`../../../build/bsd-i386/classes/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider',
needed by `copy-files'. Stop.
gmake[3]: Leaving directory
`/usr/ports/java/jdk13/work/j2sdk1.3.1/make/javax/sound'
gmake[2]: *** [optimized] Error 2
gmake[2]: Leaving directory
`/usr/ports/java/jdk13/work/j2sdk1.3.1/make/javax/sound'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory
`/usr/ports/java/jdk13/work/j2sdk1.3.1/make/javax'
gmake: *** [all] Error 1
*** Error code 2
Stop in /usr/ports/java/jdk13.
--------------------------------
I tried a make clean and then the same command just in case and same thing.
This looks like something to do with sound. Seeing as we don't actually
need sound to work I wonder if there is a way to skip that. Anyone know
where I could look?
Cheers,
Pete
--
Peter Simmons
Senior Consultant BCMPweb Limited
M:+64 21 676 909 F:+64 9 374 4250
email***@***.com http://www.bcmpweb.com
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 4
- Swing Applet, JDBC and MySQL Connector ConfusionI believe your applet must be run from a signed jar, and the MySQL database
must also be resident on the same server as the applet. I'm not 100% sure of
this in your case....but I am 99% sure. -Ike
- 5
- C++ to Java aplet, need help to understand.Hi,
I have a c++ application that uses Direct X to get images from my webcam.
Now I want to stream images from my application to the internet.
I just want to make sure I understand how a java applet would, (should?),
work.
When the user load the page where the java applet is located, the applet
makes a request to my machine for an image.
The applet then displays the image at a certain location in the page.
So a java applet does not really 'stream' videos, instead it makes a request
for an image every 'x' seconds.
All the applet needs is address and port where my application is located,
(and the name of the function that will return the frame).
Sadly I have no knowledge of Java, (well a little maybe).
Where could I find some code for an applet that would make a request to my
application.
How can a java applet make a request to a win 32 c++ application?
And what would the code look like in an html page?
Many thanks in advance for any help/code.
Simon
- 6
- executing data needs mprotect with PROT_EXECThis is a multi-part message in MIME format.
I've been trying to run some FreeBSD4 packages
inside a jail on a FreeBSD6 / amd64 box; and I've
hit a problem with ports/jdk.
A couple of places the VM uses an array of
integers, puts code in it, and executes it.
This doesn't work on machines where the CPU
honors the PROT_EXEC settings; this can be
different on different machines (depending on
BIOS settings probably).
The right fix is to call mprotect() from jdk to allow
execution of the memory in question, something like this:
--- ../../hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp Tue Feb
14 21:12:46 2006
+++ ../../hotspot/src/os_cpu/bsd_i486/vm/os_bsd_i486.cpp Wed Feb
15 16:30:49 2006
@@ -561,6 +562,9 @@
}
#else
static void (*fixcw)(void) = CAST_TO_FN_PTR(void (*)(void),
code_template);
+
+ ::mprotect((void *)code_template, sizeof(code_template),
+ PROT_EXEC | PROT_READ | PROT_WRITE);
#endif
fixcw();
--- ../../hotspot/src/cpu/i486/vm/vm_version_i486.cpp Thu Sep 11
03:40:14 2003
+++ ../../hotspot/src/cpu/i486/vm/vm_version_i486.cpp Tue Feb 14
23:34:40 2006
@@ -9,6 +9,8 @@
# include "incls/_precompiled.incl"
# include "incls/_vm_version_i486.cpp.incl"
+#include <sys/types.h>
+#include <sys/mman.h>
int VM_Version::_cpu;
int VM_Version::_cpuFeatures;
@@ -145,6 +147,10 @@
ResourceMark rm;
// Making this stub must be FIRST use of assembler
CodeBuffer* c = new CodeBuffer(address(stubCode), sizeof(stubCode));
+
+ ::mprotect((void *)stubCode, sizeof(stubCode),
+ PROT_EXEC | PROT_READ | PROT_WRITE);
+
VM_Version_StubGenerator g(c);
getPsrInfo_stub = CAST_TO_FN_PTR(_getPsrInfo_stub_t,
g.generate_getPsrInfo());
patches also attached in case the mail client mangles them :-)
- Arne H. J.
- 7
- repeating program codeI've created a program that calculates real estate commission. The person
inputs the sale amount and then enters a letter which represents a certain
commission rate. It then calculates the commission and displays it. After
the commission amount is displayed i want it to prompt the user for
another transaction. When there are no more transactions i want the
program to display the total amount of the properties entered, and the
total amount of the commissions calcualted. I'm not too sure what to do.
Should i use a while loop? Here is what i have done so far.
// RealEstateCommission.java: Calculates real estate commissions
import javax.swing.JOptionPane;
public class Calculator {
/** Main method */
public static void main(String[] args) {
double salePrice;
double commissionRate = 0;
// Enter sale price
String salePriceString = JOptionPane.showInputDialog (null,
"Enter sale price",
"Calculator Input", JOptionPane.QUESTION_MESSAGE);
salePrice = Double.parseDouble(salePriceString);
// Enter property code (residential, multidwelling or commercial)
String propertyTypeString = JOptionPane.showInputDialog (null,
"Enter property code (residential (R), multidwelling (M) or
commercial(C))",
"Calculator Input", JOptionPane.QUESTION_MESSAGE);
if (propertyTypeString.equals ("R"))
commissionRate = 0.070;
else if (propertyTypeString.equals ("M"))
commissionRate = 0.060;
else if (propertyTypeString.equals ("C"))
commissionRate = 0.035;
// Calculate commission
double commission = salePrice * commissionRate;
// Format to keep two digits after the decimal point
commission = (int)(commission * 100) / 100.0;
// Show results
JOptionPane.showMessageDialog(null,
"the commission is" + commission,
"Cakculator Output",
JOptionPane.INFORMATION_MESSAGE);
String transactionString = JOptionPane.showInputDialog (null,
"Would you like to do another transaction (YES or No)",
"Calculator Input", JOptionPane.QUESTION_MESSAGE);
while (transactionString.equals ("YES"))
System.exit(0);
}
}
- 7
- Pre-Populate a Form that nested tagsI have a Struts action form which contains a bean. I am trying to
display a bean retrieved from the database in this form using the
nested tag. Can anyone help me? I continue to get an error message
see end for stack trace.
Struts config
<form-bean name="newBean" type="com.NewForm" />
.....
<action path="/new-action" type="com.NewAction"
name="newBean" scope="session">
<forward name="blah" path="/New.jsp"/>
</action>
Bean
public class Program implements Serializable {
private int prg_pk;
private String prg_prog_name = null;
private Set courses;
getters()/setters()
Form
public class NewForm extends ActionForm {
private Program program;
/**
* Returns the program.
* @return Program
*/
public Program getTheProgram() {
return program;
}
/**
* Sets the program.
* @param program The program to set
*/
public void setTheProgram(Program program) {
this.program = program;
}
public void reset(ActionMapping mapping, HttpServletRequest
request) {
HttpSession session = request.getSession();
setTheProgram((Program) session.getAttribute("PROGRAM"));
}
}
JSP
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<nested:form action="/new-action.do">
<nested:nest property="program" >
<nested:write property="prg_prog_name"/>
</nested:nest>
</nested:form>
Stack Trace
java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:315)
at org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java:303)
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:663)
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:710)
at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:290)
at org.apache.struts.taglib.nested.bean.NestedWriteTag.doStartTag(Unknown
Source)
at org.apache.jsp.New$jsp._jspService(New$jsp.java:114)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:479)
- 7
- simplifying use of properties"Stefan Schulz" <email***@***.com> wrote in message news:<opsg4x3eg6q1fd9p@localhost>...
> The change you describe is inherently incompatible, though.
Not if you change reflexive field access to match the hardcoded
equivalent.
> In fact, the
> VM you describe is fundamentally different and incompatible to the current
> JVM.
> What you argue for is effectively another language with
> wholely different concepts.
I don't think so.
> I'll not say that these concepts in themselves
> have no merit, but in the Java programming language, they are not
> appropriate, since they run against several other principles of the
> language's
> design.
Like what?
> >> > No merit? Properties are supported in many languages like Python,
> >> > Ruby, C# and (I think) VB.
> >>
> >> So what? They are in java too (see the public modifier for fields) ;)
> > Once you have a public field in Java, you can't later replace it with
> > accessor methods without breaking clients. But in Python, Ruby & C#,
> > you can. That is what I meant by "properties" as opposed to "fields"
> > or "instance variables".
>
> No, you can't. Think about reflexive invocation - Will work with a public
> method, will not work with a inaccessable field, and getter/setter pairs.
That's not a problem; I wasn't proposing changing the semantics of the
invokevirtual instruction for somebody to complain that the parallel
using reflection behaves differently from a hardcoded invocation. What
we do need to change is reflexive field access: it should invoke the
getters & setters when the field isn't found. But that's pretty
logical.
>
> >> It will however make it even more of a living hell to explain tonovices
> >> that a setter/getter pair need not be backed by one andonly one field
> >> of the arguemnt type.
> >
> > Getter/setter pairs that are not backed with fields are used all the
> > time in Java. I'm only proposing an easier syntax for their use.
> > Regarding the novices bit, OO theory says that when you call a method,
> > you should *not* be concerned with how it's implemented. I feel you
> > should not be telling novices that a getter/setter pair always has to
> > be backed with a field.
>
> This is what i said. Most assume it has to be backed by a field, and if
> you use field access syntax, you reinforce that notion.
Maybe, but I still think it's straightforward for novices to
understand that what looks like a field access may be an invocation,
once you explain it to them. There are tougher concepts novices must
understand.
- 11
- 12
- Announcement: PerfectJPattern first release 1.0.0 available ...hi,
After long working hours have been able to finally put together a first
release of PerfectJPattern. The aim of PerfectJPattern is to build a
library of componentized (reusable and context-free) Design Patterns
in Java.
Please visit the home page under: http://perfectjpattern.sourceforge.net
Feedback most welcome!
Best regards,
Giovanni
PS: I still have plenty to work on the documentation again any feedback
with corrections/suggestions will be most welcome.
- 15
- Overheads involved in repeated acces to a database using JDBCI have an application that inserts words and their associated values
into a hashtable. If the word already exists in the hashtable, the
value associated with the word is increased in the hashtable. When the
hashtable is complete, I write its contents into a simple, two-column
table in a singer-user database using jdbc.I'm using MS Access at the
moment because my database doesn't need to support multiple -users or
very complex queries.
-Would I be better to take the hashtable out of the equation all
together? (i.e. read, write and update the values in the database as I
go along).
-Do you know if there is much overhead involved in contacting a
database in this way, as I would need to do it about 4,000 times?
I'm not sure how jdbc works.
-Can you alter the result set repeatedly and do a mass write to the
database at the end?
-Would another type of database suit my needs better?
Thanks in advance
~M
- 15
- IP-HOSTNAME Conversion ProblemHi,
I found many utilities in the web or rather the internet to resolve ip
address and host names , i took this example
host name : mp3.box.sk whose IP was resolved to be 69.31.81.51
now i took the same ip and tried to resolve the host name, for my
surprise i found that to be
colo-69-31-81-51.pilosoft.com which is not mp3.box.sk for sure, can
anyone explain as to why this problem is caused?
|
| Author |
Message |
steve

|
Posted: 2004-9-1 7:16:00 |
Top |
java-programmer, Dangerous code up for peer review
Hi,
looking for some advice,
I have a database for addresses coded in java.
to print the addresses, a jframe is popped up that holds various report
layouts.
the user chooses a layout then this launches Jasper reports.
basically when the user presses the print button is the current screen is
hidden.
then a report layout screen is popped up, ( this cannot be a modal, as it
would sit on top of any screen generated by jreports)
the problem was , as the report layout screen was not a modal , the code was
returning directly back to the "mother screen" ,and un-hiding it.
to get round this problem I have implemented a couple of linked lists, where
the mother screens sets up a separate thread and then calls the child
screens to get their status.
here is a small section of the jasper report compiler
private void CancelButton_actionPerformed(ActionEvent e) {
sendStatus(CMD_SIGNAL_GOOD_EXIT); //send exit to calling routine
this.setVisible(false);
}
private void this_windowClosed(WindowEvent e) {
sendStatus(CMD_SIGNAL_GOOD_EXIT); //send exit to calling routine
//cancel the import
//here we need to exit the screen
this.dispose();
}
......
here is the signalling routine.
public void sendStatus(int currentStatus) {
String aa = String.valueOf(currentStatus);
addWork(aa);
}
public synchronized void addWork(Object o) {
queue.addLast(o);
notify();
}
//it is possible that the program could get hung here
//if the normal flow is interrupted
public synchronized int getWork() throws InterruptedException {
while (queue.isEmpty()) {
wait();
}
return Integer.parseInt((String) queue.removeFirst());
}
to stop the mother screen from being shown i have
r = new Runnable() {
public void run() {
try {
call the layoutscreen & jasper reports here
ReportWriter doReport = new ReportWriter(params,
my_vars.dbconn, errorlogger);
while (statusFlag != CMD_SIGNAL_GOOD_EXIT) {
statusFlag = doReport.getWork();
}
} catch (Exception ex) {
Error_stuff.handleError(ex, -1, -1);
} finally {
show();
repaint(); //refresh the screen
}
}
};
new Thread(r).start();
} catch (Exception ex) {
Error_stuff.handleError(ex, -1, -1);
}
i'm not really happy with the safety of the code, even though the exceptions
and all exits from the child screen are covered, and after testing the mother
screen is always shown again, even after an error.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- avoid lot of try/catch blocksemail***@***.com, 08.02.2008 12:17:
> Hello,
>
> Is it possible in Java to write a "global" try/catch block which will
> monitor exceptions in all threads?
> In my application I have 20 JFrames and 10 methods in it, I just can't
> write 200 try/catches :)
> I've researched for several hours but haven't found any answer.
>
> Thank you.
Maybe setDefaultUncaughtExceptionHandler() is what you are looking for:
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)>
Thomas
- 2
- java virtual machine - help me please?Hello All,
I have installed jre1.4.2_14 and I have been trying to get a small "hello
world type" program to run.
Once I got jre installed, I open my dos window and changed directories to
folder on on my local drive that contains the jave program.
I then try to run it by typeing javac aus.java. The error message doesn't
recognize the command. However, when I type java the error says that it
cannot find Main string in java.lang <-- I don't have full message because I
am currently at work away from my computer. Anyway, also when I type Java in
dos it gives me all the parameters and help that I will need for using java.
I assume that dos does in fact see the java because of that. However, the
java virtual machine may or may not be set up correctly.
Will you please explain to me how to set a the virtual machine and where
source paths should be configured in JCreator LE? Any other suggestions are
welcome.
I emailed myself this message last night:
From JCreator LE: I get the following error message:
--------------------Configuration: MyProject2 - <Default> - <Default>---------
-----------
Error : Invalid path, \bin\javac.exe -source 1.5 -classpath "C:\Program Files\
Java\j2re1.4.2_14\bin" -d C:\Program" "Files\Java\j2re1.4.2_14\bin
@src_myproject2.txt"
Process completed.
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-jvm/200706/1
- 3
- How to identify a website's scale?On 8 May, 19:15, Roedy Green <email***@***.com> wrote:
> When I was in grade 5, our teacher Miss Chapman asked me if a
> hippopotamus was "big". I replied "compared to what? It is big
> compared to a dog but small compared to an elephant."
Hippopotamus size conjugates as an irregular comparison, based on the
square root of the distance between the two of you, divided by the top
speed of any vehicle that you're in. If you're within sight, in any
sort of small boat, then they're big scary f*ckers, especially the
little ones with the pushy parents.
For an animal whose usual reaction to anything startling is to fling
dung at it with its tail,
the only surprise is that they haven't yet acquired Usenet access.
- 4
- iterating active java sessionsis there a way to iterate active servlet http sessions.
or to be notified when a session is about to
be invalided/expired etc.
it'll be run by an administrative servlet every
night to make sure database resources are
released.
thx
- 5
- What Size Screen Do You Design For?Most of what I've done in Java is for a small business and any GUI had to be
able to be run in a 640x480 screen because some of the software goes on
servers that are hooked up to cheap monitors that aren't used often.
Now I'm writing some simple programs and utilities that I can use and I'm
sure others will like. I'll be releasing them as open source so people can
do what they like. I've realized that I don't have to be bound by the
640x480 screen size anymore, but I don't know what most people tend to have
as a minimum now days.
For just simple stuff that I'd like for most people to be able to use, what
can I count on as the smallest screen size in general use? I was thinking
800x600, but a few friends have told me that most people now can do larger
than that now.
So what do you count on as a screen size your Java GUI programs can expect?
Thanks!
Hal
- 6
- Limit uploaded image file dimensionsI use DiskFileUpload to upload images on my web application and am able
to restrict the file size to a defined value. Is there a way I can
restrict the dimensions(width and height) of the image uploaded using
DiskFileUpload or through some other way?
Thanks
Swetha
- 7
- Deserializing in JDK1.5 without unchecked cast warningHi,
I am using JDK1.5 and am wondering if it is possible to deserialize an
Object and not get an unchecked cast warning from the compiler when I
cast it to another type. In my code I deserialize an Object and cast
it to Hashtable<Integer, String> and I get an unchecked cast warning.
If I cast it to just a Hashtable object I don't get the warning until
I actually try and use it (e.g. with the "put" method).
I understand that I am casting an Object to a type that could cause a
runtime error (hence the warning), but how can I deserialize a
Hashtable directly?
I would like to create warning-free code for JDK1.5 and am hoping this
is not stopping me from doing it.
Thanks in advance.
- 8
- Saying "latently-typed language" is making a category mistakeDavid Hopwood wrote:
>
> A type system that required an annotation on all subprograms that do not
> provably terminate, OTOH, would not impact expressiveness at all, and would
> be very useful.
Interesting. I have always imagined doing this by allowing an
annotation on all subprograms that *do* provably terminate. If
you go the other way, you have to annotate every function that
uses general recursion (or iteration if you swing that way) and that
seems like it might be burdensome. Further, it imposes the
annotation requirement even where the programer might not
care about it, which the reverse does not do.
Marshall
- 9
- the price
want mor phase, want control more phase
in the WAVE
1) fear, rage - PAY never in God book
pay in arrogance book, you reach, or man you meet,
in sit of weak man law
as mor is manifest, less agony for the feared and enraged
because they are known as socio-economic problems,
and the whip cannot land on the fall out and dead horse,
they must have like WPA, relief, etc. and the whip put
on the architect's back
2) arrogance, pays in God law, only when weak man law
3) work is born of gift of brightness and aspiration,
or fear or rage
4) a worker, of not bad, pays only in weak man law,
improve man law, and those who work, one side or the other,
or feed both, and not play both against each other,
or THE LOST IN THE MIDDLE, get less agony, because
both sides have a purpose in Amber Alert as we discussed,
in the FEAR factor, or what happens, when you leave
uppy up world
5) and such, we have a far more forbidden fruit, INDEED
you must lose any concept of RIGHT AND WRONG AND GOOD and
NOT GOOD = BAD, in order to cross THE LINE on yourself,
in that moment the mass reaches you
6) in such, a greater respect for oneself, and more scales
in WHITE HORSE than BLACK
we have a PALE HORSE, if it grows, it will be FAR WORSE, than BLACK,
for those that CROSS THE LINE, yes, that does mean, on
yourself too, but if you are on the steeple, with the pretty people,
why, even Ayn Rand would HEED LEVIATHAN call, as pretty
as the people are today, and if you are on the steeple, and not
just among the people, besides leading the people to the steeple
the only place princess has to go, is down ...
perhaps you will not be ripe on the steeple, and an
alternating current like I, if ripe, you will indeed give
your soul to THE FIRE YOU KNOW BEST, in your little world,
in front of the vanity mirror, primping and waiting for THE CALL
of the DARK MASS and FIRE DANCE
if you are like alternating current like me, VERY AWAKE and all
such, such a "scene" would require much loving lingerie care,
NOT IMPOSSIBLE, consider it a challenge, when I am on the steeple,
if I have led all the pretty people, and the ugly to pretty,
and NIRVANA on earth, then I want my orgasm too, as a man/woman/hermophrodite,
and every "scene" listed here http://www.mysolution.ws/LIFESTYLE.html
as God and man's law, which includes the mores in the air of community
you are in, in county, state, nation, earth, etc.
if you have your orgasm, before the steeple, you can always forget
in OBSCURE CLOUD DIAGRAM, and be architected into a new instantiation
BEHOLD, for chaos, has always, been ordered and CLOUD DIAGRAM, only
OBSCURE to those gifted with sleep, or Trojan HORSED to sleep
irrationality exists
rationality exists
both are bound by existentialism, either do exist or do not
and in such there are bounds to both
with each prevalent in different phases, facets
WHAT CLOUD DIAGRAM ARE YOU IN? or do you want to be in?
want mor phase, want control more phase
in the WAVE
1) fear, rage - PAY never in God book
pay in arrogance book, you reach, or man you meet,
in sit of weak man law
as mor is manifest, less agony for the feared and enraged
because they are known as socio-economic problems,
and the whip cannot land on the fall out and dead horse,
they must have like WPA, relief, etc. and the whip put
on the architect's back
2) arrogance, pays in God law, only when weak man law
3) work is born of gift of brightness and aspiration,
or fear or rage
4) a worker, of not bad, pays only in weak man law,
improve man law, and those who work, one side or the other,
or feed both, and not play both against each other,
or THE LOST IN THE MIDDLE, get less agony, because
both sides have a purpose in Amber Alert as we discussed,
in the FEAR factor, or what happens, when you leave
uppy up world
5) and such, we have a far more forbidden fruit, INDEED
you must lose any concept of RIGHT AND WRONG AND GOOD and
NOT GOOD = BAD, in order to cross THE LINE on yourself,
in that moment the mass reaches you
6) in such, a greater respect for oneself, and more scales
in WHITE HORSE than BLACK
we have a PALE HORSE, if it grows, it will be FAR WORSE, than BLACK,
for those that CROSS THE LINE, yes, that does mean, on
yourself too, but if you are on the steeple, with the pretty people,
why, even Ayn Rand would HEED LEVIATHAN call, as pretty
as the people are today, and if you are on the steeple, and not
just among the people, besides leading the people to the steeple
the only place princess has to go, is down ...
perhaps you will not be ripe on the steeple, and an
alternating current like I, if ripe, you will indeed give
your soul to THE FIRE YOU KNOW BEST, in your little world,
in front of the vanity mirror, primping and waiting for THE CALL
of the DARK MASS and FIRE DANCE
if you are like alternating current like me, VERY AWAKE and all
such, such a "scene" would require much loving lingerie care,
NOT IMPOSSIBLE, consider it a challenge, when I am on the steeple,
if I have led all the pretty people, and the ugly to pretty,
and NIRVANA on earth, then I want my orgasm too, as a man/woman/hermophrodite,
and every "scene" listed here http://www.mysolution.ws/LIFESTYLE.html
as God and man's law, which includes the mores in the air of community
you are in, in county, state, nation, earth, etc.
if you have your orgasm, before the steeple, you can always forget
in OBSCURE CLOUD DIAGRAM, and be architected into a new instantiation
BEHOLD, for chaos, has always, been ordered and CLOUD DIAGRAM, only
OBSCURE to those gifted with sleep, or Trojan HORSED to sleep
irrationality exists
rationality exists
both are bound by existentialism, either do exist or do not
and in such there are bounds to both
with each prevalent in different phases, facets
WHAT CLOUD DIAGRAM ARE YOU IN? or do you want to be in?
want mor phase, want control more phase
in the WAVE
1) fear, rage - PAY never in God book
pay in arrogance book, you reach, or man you meet,
in sit of weak man law
as mor is manifest, less agony for the feared and enraged
because they are known as socio-economic problems,
and the whip cannot land on the fall out and dead horse,
they must have like WPA, relief, etc. and the whip put
on the architect's back
2) arrogance, pays in God law, only when weak man law
3) work is born of gift of brightness and aspiration,
or fear or rage
4) a worker, of not bad, pays only in weak man law,
improve man law, and those who work, one side or the other,
or feed both, and not play both against each other,
or THE LOST IN THE MIDDLE, get less agony, because
both sides have a purpose in Amber Alert as we discussed,
in the FEAR factor, or what happens, when you leave
uppy up world
5) and such, we have a far more forbidden fruit, INDEED
you must lose any concept of RIGHT AND WRONG AND GOOD and
NOT GOOD = BAD, in order to cross THE LINE on yourself,
in that moment the mass reaches you
6) in such, a greater respect for oneself, and more scales
in WHITE HORSE than BLACK
we have a PALE HORSE, if it grows, it will be FAR WORSE, than BLACK,
for those that CROSS THE LINE, yes, that does mean, on
yourself too, but if you are on the steeple, with the pretty people,
why, even Ayn Rand would HEED LEVIATHAN call, as pretty
as the people are today, and if you are on the steeple, and not
just among the people, besides leading the people to the steeple
the only place princess has to go, is down ...
perhaps you will not be ripe on the steeple, and an
alternating current like I, if ripe, you will indeed give
your soul to THE FIRE YOU KNOW BEST, in your little world,
in front of the vanity mirror, primping and waiting for THE CALL
of the DARK MASS and FIRE DANCE
if you are like alternating current like me, VERY AWAKE and all
such, such a "scene" would require much loving lingerie care,
NOT IMPOSSIBLE, consider it a challenge, when I am on the steeple,
if I have led all the pretty people, and the ugly to pretty,
and NIRVANA on earth, then I want my orgasm too, as a man/woman/hermophrodite,
and every "scene" listed here http://www.mysolution.ws/LIFESTYLE.html
as God and man's law, which includes the mores in the air of community
you are in, in county, state, nation, earth, etc.
if you have your orgasm, before the steeple, you can always forget
in OBSCURE CLOUD DIAGRAM, and be architected into a new instantiation
BEHOLD, for chaos, has always, been ordered and CLOUD DIAGRAM, only
OBSCURE to those gifted with sleep, or Trojan HORSED to sleep
irrationality exists
rationality exists
both are bound by existentialism, either do exist or do not
and in such there are bounds to both
with each prevalent in different phases, facets
WHAT CLOUD DIAGRAM ARE YOU IN? or do you want to be in?
want mor phase, want control more phase
in the WAVE
1) fear, rage - PAY never in God book
pay in arrogance book, you reach, or man you meet,
in sit of weak man law
as mor is manifest, less agony for the feared and enraged
because they are known as socio-economic problems,
and the whip cannot land on the fall out and dead horse,
they must have like WPA, relief, etc. and the whip put
on the architect's back
2) arrogance, pays in God law, only when weak man law
3) work is born of gift of brightness and aspiration,
or fear or rage
4) a worker, of not bad, pays only in weak man law,
improve man law, and those who work, one side or the other,
or feed both, and not play both against each other,
or THE LOST IN THE MIDDLE, get less agony, because
both sides have a purpose in Amber Alert as we discussed,
in the FEAR factor, or what happens, when you leave
uppy up world
5) and such, we have a far more forbidden fruit, INDEED
you must lose any concept of RIGHT AND WRONG AND GOOD and
NOT GOOD = BAD, in order to cross THE LINE on yourself,
in that moment the mass reaches you
6) in such, a greater respect for oneself, and more scales
in WHITE HORSE than BLACK
we have a PALE HORSE, if it grows, it will be FAR WORSE, than BLACK,
for those that CROSS THE LINE, yes, that does mean, on
yourself too, but if you are on the steeple, with the pretty people,
why, even Ayn Rand would HEED LEVIATHAN call, as pretty
as the people are today, and if you are on the steeple, and not
just among the people, besides leading the people to the steeple
the only place princess has to go, is down ...
perhaps you will not be ripe on the steeple, and an
alternating current like I, if ripe, you will indeed give
your soul to THE FIRE YOU KNOW BEST, in your little world,
in front of the vanity mirror, primping and waiting for THE CALL
of the DARK MASS and FIRE DANCE
if you are like alternating current like me, VERY AWAKE and all
such, such a "scene" would require much loving lingerie care,
NOT IMPOSSIBLE, consider it a challenge, when I am on the steeple,
if I have led all the pretty people, and the ugly to pretty,
and NIRVANA on earth, then I want my orgasm too, as a man/woman/hermophrodite,
and every "scene" listed here http://www.mysolution.ws/LIFESTYLE.html
as God and man's law, which includes the mores in the air of community
you are in, in county, state, nation, earth, etc.
if you have your orgasm, before the steeple, you can always forget
in OBSCURE CLOUD DIAGRAM, and be architected into a new instantiation
BEHOLD, for chaos, has always, been ordered and CLOUD DIAGRAM, only
OBSCURE to those gifted with sleep, or Trojan HORSED to sleep
irrationality exists
rationality exists
both are bound by existentialism, either do exist or do not
and in such there are bounds to both
with each prevalent in different phases, facets
WHAT CLOUD DIAGRAM ARE YOU IN? or do you want to be in?
--
Comrade
solution to THEE world's problems?
http://www.mysolution.ws
K'ihnich Yax K'uk Mo ? http://www.mysolution.ws/CreatorGods.pdf
- 10
- Running java programs from class filesNigel Wade wrote:
> Knute Johnson wrote:
>
>> Babu Kalakrishnan wrote:
>>> Knute Johnson wrote:
>>>> Babu Kalakrishnan wrote:
>>>>
>>>>> Knute Johnson wrote:
>>>>>
>>>>>> Oliver Wong wrote:
>>>>>>
>>>>>>> "Knute Johnson" <email***@***.com> wrote in message
>>>>>>> news:qe%Ig.2$email***@***.com...
>>>>>>>
>>>>>>>> Babu Kalakrishnan wrote:
>>>>>>>>
>>>>>>>>> The commandline for the above example in that case would be :
>>>>>>>>>
>>>>>>>>> java -classpath /xyz/abc MyPackage.MyClass
>>>>>>>>>
>>>>>>>> That doesn't work for me although I have seen reference to it before
>>>>>>>> like that. Could it be that it doesn't work on Windows like that?
>>>>>>> It works for me on WinXP SP2:
>>>>>>>
>>>>>>> java -cp "D:\Oliver's Documents\Workspace\Test\bin" D
>>>>>>>
>>>>>>> to run a class called "D" with no package whose classfile is in
>>>>>>> "D:\Oliver's Documents\Workspace\Test\bin"
>>>>>>>
>>>>>>> - Oliver
>>>>>> That does for me too. But put it in a package and it won't.
>>>>>>
>>>>> Interesting - Seems to work for me even with classes within a package -
>>>>>
>>>>> Running TCPServer.class in package test :
>>>>>
>>>>> java -classpath "C;\Documents and
>>>>> Settings\Babu\workspace\TestServer\classes" test.TCPServer
>>>>> Main: Listening for connections on port 2345
>>>>>
>>>>> Testing on XP Home SP2
>>>>>
>>>>> BK
>>>>>
>>>> package test;
>>>>
>>>> public class Test {
>>>> public static void main(String[] args) {
>>>> System.out.println("It works!");
>>>> }
>>>> }
>>>>
>>>> C:\>javac test/Test.java
>>>>
>>> I'd assume that you now have Test.java and Test.class inside C:\test.
>>>
>>>> C:\>java test.Test
>>>> It works!
>>>>
>>> OK - here the default classpath assumed by the JVM is "." (which is
>>> "C:\"), so it works
>>>
>>>> C:\>cd test
>>>>
>>>> C:\test>java -cp "C:\test" test.Test
>>>> Exception in thread "main" java.lang.NoClassDefFoundError: test/Test
>>>>
>>> Your commandline here should be :
>>>
>>> java -cp "C:\" test.Test
>>>
>>> because the classpath is to be set to the root of the package hierarchy
>>> - which is C:\ in your case.
>>>
>>> With the commandline you used, the class file is expected to be
>>> C:\test\test\Test.class
>>>
>>>
>>> BK
>> Thank you so much guys, this has confused the s**t out of me for years.
>> I think the most confusing part is the root business.
>>
>> So now that you solved that one, show me how to use a jar library on the
>> command line when I run a java program. I can make it compile but I
>> can't make it run. I can get it to work if I put the jar file in the
>> Class-Path: line in the manifest and put the jar file in the same
>> directory as the program jar file but not from the command line.
>>
>
> You can't. It is specifically mentioned in the java man page. When running a jar
> with the java -jar command syntax, the -cp flag is ignored. The jar file is the
> sole definition of the classpath.
Well that's a relief. At least I know now that I'm not going completely
nuts.
> If your executable jar requires classes from other jars, those jars must be
> added to the Class-Path: section of the executable jar's manifest. To further
> annoy you the paths in Class-Path: should be relative paths (although absolute
> paths do work, at least on Linux). I'm not surprised you're confused, you're
> not the only one. I suppose it does offer some measure of security in that a
> user of your application can't change the classpath to inject their own jar's
> to intercept private information from within the application. Although there's
> nothing to stop them unpacking the jar, and re-packaging it with a different
> manifest. So what the purpose really is, other than to annoy and confuse,
> escapes me.
>
Thanks very much Nigel.
--
Knute Johnson
email s/nospam/knute/
- 11
- Cock Starved Housewife Gets Fucked With Her Legs Spread Wide Just few link on some movies...
All just for you...
Download
>>>>> http://download-video.12w.net
>>>>> http://world-sex.urllogs.com
>>>>> http://video-sex.12w.net
CLICK FREE DOWNLOAD VIDEO PORN...
L
I
C
K
T
O
W
A
T
C
H
V
I
D
E
O
P
O
R
N
D
O
W
N
L
O
A
D
F
R
E
E
.
.
.
W
E
L
C
O
M
T
O
M
O
V
I
E
S
P
O
R
N
D
O
W
N
L
O
A
D
.
.
.
- 12
- Problem in configuring eclipse to point to a jdk instead of jreHi all,
I am trying to use eclipse as the IDE with the m2eclipse plugin; I
have created the project structure using maven2 in the command line;
then I create the eclipse project files with "mvn eclipse:eclipse"
When I import the project into eclipse... the maven2 builder has
errors such as "tools.jar is missing" or "1 artifact is missing"
I searched a few forumns and found that eclipse didn't use JDK but JRE
to compile classes and tools.jar is only available under JDK....
So my question is how to solve this problem? I've tried to create
another JRE to point to JDK folder... but failed
PS. I could build the whole project under command line "mvn clean
compile"
I'm using a Windows XP Professional OS; maven 2.0.7; jdk 1.5.0.12;
eclipse Europa
>From Jason (Kusanagihk)
- 13
- Novell Tutorial: Building_A_Modern_Web_Application
http://developer.novell.com/wiki/index.php/Building_A_Modern_Web_Application
"As companies become more reliant on the Web, it is increasingly
important to deliver applications using the browsers that have the same
functionality as rich clients. Programming applications using HTML,
cascading style sheets (CSS), and Asynchronous JavaScript and XML (AJAX)
on the front end and using a Linux, Apache, MySQL, and PHP (LAMP) stack
on the back end helps to fill this gap."
"Everything presented in this article was done on a SUSE 10.0
workstation using the following versions of software:
* Apache 2.0.54-10.3
* MySQL 4.1.13-3
* PHP 4.4.0-6.8
* Firefox 1.5 "
--
The Texeme Construct
http://you-read-it-here-first.com
- 14
- parallel port and javai want to communicate with parallel port of the computer , i am using
windows xp service pack 2, can any body help me?
- 15
- java/105369: problem with port diablo-jdk15
>Number: 105369
>Category: java
>Synopsis: problem with port diablo-jdk15
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-java
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Fri Nov 10 10:20:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: rafal kotusiewicz
>Release: 6.2 Beta 2
>Organization:
gdp.pl
>Environment:
all
>Description:
When I tried install java from port diablo-jdk15 then I have a problem. Port installer suggest me get java port v. 1.5.0_07-b00 (tgz) from http://www.freebsdfoundation.org/downloads/java.shtml. When I go to this url, I'm not found this package, only 1.5.0_07-b01.
>How-To-Repeat:
as root
%cd /usr/ports/java/diablo-jdk15/ && make install
>Fix:
After downloaded available version of port I changed the checksums of archives (MD5 and sha256) and rename the archive. Then make install work nicely but is not best of method :)
>Release-Note:
>Audit-Trail:
>Unformatted:
|
|
|