 |
 |
Index ‹ java-programmer
|
- Previous
- 3
- Opportunities in U.K./Great Britain?I have a friend who recently moved to Madrid. He had a Dutch passport
so EU access was relatively easy for him. We both lived in D.C., but
I remain US citizen by birth.
My question is, he says it's becoming more popular for J2EE
development in Great
Britain and the UK. I'm wondering how good is the market? (in
relation to US) How good is it for US programmers? (any demand for US
borne skills) And if any of these are true, how hard it is securing
work permit? (etc) Finally is there any idea what standard of living
might be like?
Given all of this would there be sacrifices, or would it just be
better overall simply to stay in US?
- 7
- load servlet mappings at runtime in tomcatCan anyone suggest a way to achieve dynamic servlet mappings in tomcat 5.5.
What I want to do is run a web app with any number of paths all pointing to
one servlet. These paths would be loaded from a database and extra paths
can be added at runtime by the user. So an example would be
www.domain.com/sample and www.domain.com/anothersample would both execute
the same servlet.
Another option I thought of was having a custom 404 servlet that would check
the request supplied and then redirect.
- 8
- want to sort tables inside a complex mechanism, what can be the approach?I have a situation where first we are fecthing some ids(list of say
version ids using hibernate form database)
then keeping those list of data in a Pager Object(Paging mechanism
displays 100 rows per page out of complete sa 100 or so.)
This pager class does two things one takes whole list of ids
(Collection of version_id).
(Every time based on search criteria it changes. For searching in
hibernate values are hardcoded. Want modification with minimal changes
as many things are interrelated here.)
and other thing it checks no. of contents based on that displays data
per page(100 here).
It means stores all data from database and send it oage by page.(First
thing to notice)
Next all this is getting stored in Report page where it searches other
column names based on ids(version_id) the other column names are
getting changed for different requests so what we do is take all other
columns collectAllExtraFields(this is also getting changed everytime
based on what is getting searched.)
Now all this is getting accumulated while displaying but as we know
what to display we hardcoded all fields required to display based on
search. But all fields are searched based on the id fetched from
database first time which Pages is storing.
like this
Search for product user information & retrun results in the form of a
paged table for components used by specific product
ComponentVersion versionObj =
versionHandler.getComponentVersion(versionId);
String CAUsers = ctHelp.getCAUsersSection(versionId);
tableBody = tableBody + ((i%2 == 0) ? "<tr
class='table_banded_row' valign='top'>" : "<tr class='table_row'
valign='top'>");
tableBody = tableBody + "<td class='table_data'>" +
procHelper.getCompVersionLink(versionId,
versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
tableBody = tableBody + "<td class='table_data'>" +
CAUsers + "</td>";
tableBody = tableBody + "<td class='table_data'><span
class='data'>" +
versionObj.getComponent().getType() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span
class='data'>" +
versionObj.getComponent().getVendor() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span
class='data'>" +
versionObj.getRecommendationType() + "</span></td>";
tableBody = tableBody + "</tr>";
/** Get ComponentVersion ID with hyperlink to ComponentVersion Detail
page
*/
public String getCompVersionLink(long versionId, String compName,
String compVersion){
return "<a class='datalink' title='" +
this.getComponentFlyOverText(versionId) + "'
href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId="
+ versionId + "'>" + compName + " " + compVersion + "</a>";
}
this is getting called by Report.jsp to display.
As this is getting changed everytime its called form classes not used
in jsp directly i think.
Now original objective is to sort all these displayed columns.
If user clicks on any of the column name everything sholud get sorted
on that basis.but sholud not call databse for same again by using same
id and mapping with any new column name this sholud be done. Paging
mechinasm to be used as it is if possible without major changes.
i don't know where to start with as started looking on this code just
2-3 days back only.
Vj
- 8
- ain't java grand ?I just got this error message from the java 4.2 compiler.
---
Consulting.java:152: cannot resolve symbol
symbol : variable $
location: class Consulting
perchance you meant '.'
---
Ain't it just the coolest message you've ever seen?
- 8
- History of objects?Hi
a relatively complex project I am working on now has a need for
"versioning". I mean, we have a system for administration of data (creating
and updating) in a database, and this data needs to be saved as separate
versions each time it is updated - a lot like a CVS.
The data is in the main "bridges", which have lots of data (name, location,
height etc), and lots of related data: persons (controller, supervisor);
tasks to be performed...
It should for example be possible for a user to view a "bridge" as it looked
on a certain date in the past, with all its related data (as they also were
at that date).
Does anyone have some good ideas about how we can save a history of versions
of all our objects? Where can I start to look for good ideas? Could we use
CVS via some sort of java api?
Thanks,
Peter
- 9
- Problem with IN parameters to an Oracle stored procedureHello all
I had earlier posted the same problem I am having on
comp.java.lang.programmer earlier and someone suggested this post
would probably fall better under this group. Here is the link to the
original post with the original post copy pasted below.
http://groups.google.co.in/group/comp.lang.java.programmer/browse_thread/thread/b0b845981c3e403a/#
Since then I have changed the IN parameter to my stored procedure to
read as
clID IN TABLEA.CLIENTID%TYPE
instead of clientID, based on a suggestion to the earlier post and
have still had no luck.
Any suggestions are welcome.
Thanks
Swetha
- 9
- using jsp:setProperty on non-simple types.Hi,
I'm currently having a small problem with my application. I'm using
some simple classes that wraps simple types to help me provide multiple
representation. For example, a DateCBO calls wraps the Date type and
gives me the oportunity to have various 'getters' like
getDateShortFormat(), getHtml(), getDateLongFormat() and so on.
My beans are using this kind of wrappers as their properties.
I have already made a custom tag to retrieve information that i use
instead of the standard jsp:getProperty
Now, i'm trying to use the jsp:setProperty to initialise the bean
property, but i have 'Could not coerce String to non-primitive type
StringCBO without bean property editor (JSP 1.2: 2.13.2.1) at line 13'
error.
Is there an interface that i can use to allow direct usage of
'jsp:setProperty', or should i create a custom tag as well.
thanks.
- 9
- tomcatI just installed Tomcat 5.5 and went to http://127.0.0.1:8080/. Then I
clicked on Servlet Examples to see what examples it comes with, but I
got a 404 File not found error. Anyone know what the deal is? Are the
servlet examples separate?
- 10
- Eclipse 3.3 - external tool arguments issue.
I run the WebSphere command line wsadmin java tool as external tool in
Eclipse. It works fine except where an External tool argument has an
"=" sign as in "-javaoption -Dcom.ibm.ws.management.standalone2=xxxx".
Wsadmin picks up the "-Dcom.ibm.ws.management.standalone2" variable
but not the value. Seems that the Eclipse "arguments" dialog
truncates values after the "=" sign. Is there a way around this.
The arguments are listed below.
-user 1234 -password xyz
-lang jacl -host 11.11.11.11. -port 1111
-javaoption -Dcom.ibm.ws.management.standalone2=xxxx
-wsadmin_classpath C:\WASAdminSBV\WSAdmin\WAS5.1\JACL\proclib.jar
-f ${resource_loc}
The problem does not occur when Wsadmin is run from the command line.
- 10
- List helpHi,
I am new to Java.
I've been working on this project for some time now and I cannot get it
to work.
This is supposed to be a linked list.
I need to use an insert method that alphabetically adds a new title to
the list. This code I have here doesn't have a working compareTo method
but only a test to add node to the list.
This code was provided to me and I must add an insert that will put a new
item in alphabetically order. Don't tell me the answer - I just don't
understand why this doesn't work. I hope that what I've written here is
clear.
Thanks
John
Main looks like this something like this:
main(String [] args){
BookList book = new BookList();
book.add (new Book ("title of book"));
}
// ----------------Test compareTo
public int compareTo(Node a, Node b){
// Since I couldn't get this to work either, I test to see if I can get
any value.
println(a.book.compareTo(b.book)); // doesn't work I don't know how to
compare the titles
return 0;
}
public class BookList
{
private BookNode head;
//----------------------------------------------------------------
// Sets up an initially empty list of books.
//----------------------------------------------------------------
BookList()
{
head = null;
}
//----------------------------------------------------------------
// Creates a new Book object and adds it to the end of
// the linked list.
//----------------------------------------------------------------
public void insert (Book newBook){
BookNode node = new BookNode (newBook);
BookNode current;
BookNode prev;
if (head == null)
head = node;
else
{
current = head;
while (current.next != null){
// Orignally this method looped through the whole list until it found the
end, then add the new
// to the bottom.
// I did a test here to see if I could move the list around.
// This is what I think should happen: save current in prev. get next with
current.
// try to put node in from of current.next. It seems no matter what I try
there's a null pointer
// error. I just can't figure this out.
prev = current;
current = current.next;
node.prev = current.prev;
node.next = current;
node.prev.next = node;
current.prev = node;
}
current.next = node;
}
}
//*****************************************************************
// An inner class that represents a node in the book list. The
// public variables are accessed by the BookList class.
//*****************************************************************
private class BookNode
{
public Book book;
public BookNode next;
public BookNode prev;
//--------------------------------------------------------------
// Sets up the node
//--------------------------------------------------------------
public BookNode (Book theBook)
{
book = theBook;
next = null;
prev = null;
}
}
}
- 10
- Play audio clip in an ApplicationI'm trying to play an audio clip by using Applet's newAudioClip()
method. That method takes a URL. The .wav file is located in a jar file
(the only jar file). For example:
if myJar.jar is the only jar file
"java -jar myJar.jar" launches the application correctly and everything
is wonderful. My audio clip won't play because I don't know how to
access the .wav file from the jar file.
This code snippet works fine when I'm not running from the jar file:
try
{
File currentDir = new File(".");
URL currentDirURL = currentDir.toURL();
URL url = new URL(currentDirURL, fileName);
AudioClip clip = Applet.newAudioClip(url);
clip.play();
}
catch (Exception e)
{
e.printStackTrace();
}
It knows to look for the sound file in the current directory. How do I
adjust this code to look for the sound file in the jar.
I have a feeling it's an easy answer involving class.getResource().....
- 10
- Regular expressions question!I'm trying to parse HTML tables, so I need to find following pieces of text!
<table .....anything between this ..... /table> and
<tr ........ /tr> and
of course
<td> 'part that I need' </td>
I do not know how to put that into regular expression!
Thanks!
- 11
- 16
- ... to see if I can post ...
I attempted to respond to the response to my latest post,
or to thank him twice, but not shown. What is going on?
- 16
- How to convert a C++ Object to a JNI jobject in order to use GetObjectClassI have an interface object of type ISubscribe and I am trying to cast
the ISubscribe object to a jobject so I can call GetObjectClass in
order to proceed with a callback using JNI.
ISubscribe * s
jclass cls = env->GetObjectClass(s);
Does anyone know how I can do this in C++? I tried using
reinterpret_cast<jobject>(s) but GetObjectClass does not like that. Any
ideas would be appreciated.
Thanks,
Vijayk
|
| Author |
Message |
aaronfude

|
Posted: 2006-11-9 6:08:00 |
Top |
java-programmer, JDialog focus
Hi,
Is it possible to ensure that, upon setVisible(true), a JDialog pop-up
jumps on top of all other windows including other applications?
Many thanks in advance!
Aaron Fude
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2006-11-9 9:20:00 |
Top |
java-programmer >> JDialog focus
email***@***.com wrote:
...
> Is it possible to ensure that, upon setVisible(true), a JDialog pop-up
> jumps on top of all other windows ...
modal true.
>...including other applications?
setAlwaysOnTop()
Andrew T.
|
| |
|
| |
 |
Eric Sosman

|
Posted: 2006-11-10 0:07:00 |
Top |
java-programmer >> JDialog focus
email***@***.com wrote On 11/08/06 17:08,:
> Hi,
>
> Is it possible to ensure that, upon setVisible(true), a JDialog pop-up
> jumps on top of all other windows including other applications?
You can "suggest" that behavior (see Andrew Thompson's
response), but obviously you cannot "ensure" it. Consider:
What happens when two different applications both try to
make their windows do this?
--
email***@***.com
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2006-11-10 7:26:00 |
Top |
java-programmer >> JDialog focus
Eric Sosman wrote:
> email***@***.com wrote On 11/08/06 17:08,:
> > Hi,
> >
> > Is it possible to ensure that, upon setVisible(true), a JDialog pop-up
> > jumps on top of all other windows including other applications?
>
> You can "suggest" that behavior (see Andrew Thompson's
> response), but obviously you cannot "ensure" it. Consider:
> What happens when two different applications both try to
> make their windows do this?
I think it should come down to whichever app. has
the biggest bull-bar.
( ..do I even need to add a 'smiley' to that? )
Andrew T.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Four Mobile Phone Makers to Create Linux Platform
Roy Schestowitz wrote:
> Mobile phone companies join forces on Linux
>
> ,----[ Quote ]
> | Four mobile handset makers are teaming up with two cellular operators
> | to develop a new Linux software platform for mobile devices.
> |
> |
> | Cell phone makers Motorola, NEC, Panasonic Mobile Communications and
> | Samsung Electronics, along with mobile operators NTT DoCoMo and Vodafone,
> | expect to announce on Thursday plans to form an independent foundation to
> | develop a common mobile Linux-based platform. They will use this platform
> | to develop new products, applications and features.
> |
> | Linux, an open-source operating system, is already available on a wide
> | range of mobile handsets. Motorola alone says it has shipped more than
> | 5 million Linux-based handsets, mostly on smart phones, such as the
> | Ming model shipped in China. In addition, Motorola just launched the new
> | Rokr E2 music phone in Asia, which also uses Linux. The Rokr E2 will
> | soon ship in Europe.
> `----
>
> http://news.com.com/2100-1039_3-6083883.html?part=rss&tag=6083883&subj=news
>
> If this is not proof of GNU/Linux taking over, I don't know what is... Nokia,
> Palm and others are no exception.
Symbian is by far the dominant mobile OS worldwide and don't see that
changing soon, although tons of linux phone shipments to china, which
has the largest mobile subscriber base in the world holds hope.
As always, Java ME is the application platform for all these devices.
*Posted from my u know what...
- 2
- Java Web Start from CDRoedy Green wrote:
> On Sun, 19 Oct 2003 04:10:19 +0100, "Mike"
> <email***@***.com> wrote or quoted :
>
>>I don't recall having to do that once JWS is installed on the client. The
>>only thing that springs to mind is setting the mime type on a web server:
>
> I got friend to do a JRE install on a Java virgin machine, and lo to
> my delight, it set up the association.
>
> I now how have a self installing Java Web Start CD. I am 99% there. I
> think the problem has to do when you use trailing / and when you
> don't.
>
> You just put it in, and up comes the familiar dialog box about "do you
> Trust this Roedy Green fellah with this certificate."
>
> The key is this little C: program that autorun.inf
> kicks off.. It is crude but simple. It depends on 26 variants of the
> JNLP file being automatically generated.
In a platform-portable language, this is unbelievable. You've prevented use
of your product on anything but Windows.
--
Paul Lutus
http://www.arachnoid.com
- 3
- JSP web hosting companies?I have account at http://www.eatj.com/index.jsp. It is good one.
Daniel wrote:
> Does anyone know of web hosting companies supporting JSP?
- 4
- JButton layout - equal width with no absurd stretchThank you for taking the time to enlighten me. I have been searching
and trying different things but nothing seems to work for me. All I
want to do is have a column of JButtons to the left of a JScrollPane.
I want the buttons to have equal widths (the widest button at its
minimum text-fitting width, all others stretched to an equal width) and
be only as high as they need to be for their text. The scroll pane can
fill the rest of the width (and height for that matter). Something
like this:
+----------------------------------+
| |
| +--------+ +-------------------+ |
| | A | | | |
| +--------+ | | |
| | ABCDEF | | | |
| +--------+ | JScrollPane | |
| | ABCD | | | |
| +--------+ | | |
| | | |
| +-------------------+ |
| |
+----------------------------------+
I tried box layout, but then the buttons are not equal widths. Border
layout makes the buttons equal widths, but stretches them to be as high
as the scroll pane. Grid layout stretches them both vertically and
horizontally. I think I tried gridbag layout and had the same problem
as grid layout. The type of layout I want for the buttons reminds me of
how a table would layout in an HTML document. I want to avoid using
literal size values because of L&F issues on other platforms. Shrinking
the height of the scroll pane is not an option. Does anyone have any
suggestions?
- 5
- [OT] Project documentationWell, they _are_ all Java projects... but it's OT, I know. I need to get a
handle on project documentation. Can someone toss out some options for
generating documentation? What is (or could be) behind the numbered
chapter/section/subsection format of the various PDF files (specifications
and manuals) that I download?
I have so far adopted the xml and xsl transform found in many Apache and
Jakarta projects, and that has helped tremendously for HTML documentation,
but I need to be able to hand over a document and say 'this is what I'm
building'.
Thanks,
Wendy
- 6
- JSpinner causes trouble to JB 2005 designer...X-No-Archive: yes
Hi.
I try to build a GUI with the JB 2005 designer (JB 2005
Enterprise-Trial/Fondation version).
Basically it works until I want to add a JSpinner component. Then this
error happens: "null processing BeanInfo class
javax.swing.JSpinnerBeanInfo"
The component is not added. So I add it manually. But the rest of the
GUI components (following the JSpinner member variable) is mixed up
then.
Is there a workaround to this? Thanks.
-ric
- 7
- mouseClicked vs. mousePressed on Apple vs. WindowsI'm writing a Swing component which must function similarly on Apple
and Windows; and am having trouble with which event to fire off of
(this is effectively a toggle button which would ideally just be
interested in mouseClicked). For a variety of other reasons, I don't
want to make my code act on the mousePressed event.
Originally, our QA person asserted that it was busted because she was
clicking (and moving the mouse > 10 pixels) and it wasn't getting
"toggled" (this was on Windows). I won the battle there by saying
"don't move it 10 pixels; that's a drag, not a click". (after
debugging and figuring out that if you moved the mouse more than
approximately that much, the mouseClicked never came in).
However, she now claims that on Apple (OSX) that the button fails to
toggle if you move the mouse even one pixel while pressing the button.
(i.e. if you are not perfectly still while clicking).
Obviously this would be a different story. I don't have immediate
access to an Apple machine, so was wondering if anybody else had seen
this behavior. When I worked on the AWT on OS/2 at IBM, it was fairly
clear that the mouse events were determined based on native operating
system events (i.e. when Windows says it is a click, we'll say it is a
click). Don't know if that's true now or not, since I haven't seen the
code since Java 1.1.8.
---
Mike Dahmus
m dah mus @ at @ io.com
- 8
- FREE JAVA GUIDE- free Java, j2ee, sql and plsql tutorialsThis site lists General Java tutorials and tutorials on specific Java
programming topics. This site lists fully documented java tutorials, java
servlets, JSP pages, and related Java technologies like sql tutorials and
plsql tutorials
All this at http://www.freejavaguide.com
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200604/1
- 9
- [encoding]Stupid question regarding encodingI have written a java plugin for an application that reads a file to execute
a series of actions ; when I parse my text file I check for the existence
of the following line "#HEADER" ; it works fine on my equipment ; on
Windows somebody working with the text file encoded in utf-8 told me that
there is problem as the line containing "#HEADER" is not found !
Now I am a little bit puzzled about all this :
(a) when you write java code and compile it what happens to the
string "#HEADER" because it will be used in the following test :
if (line.equals("#HEADER") {...}
where line is read from the text file with encoding as is on the machine
where the class is executed ? in other words you are comparing what to
what ?
(b) when with a Java app you read a text file can you get its encoding
format like utf-8 or ANSI or whatever to decide about some actions to be
taken ?
I think the problem could be easily solved by replacing "#HEADER"
by "_HEADER" but I have to go to the bottom of this to understand what is
going on.
Thanks
- 10
- Ultimate enterprise design pattern for 3 tiered appsSo, I feel I am close here is what I have so far.
Goal: Database driven selection of controls on forms
Goal: Business rules only aware of interfaces
Goal: Presentation layer only aware of interfaces
Database Table Person: Name, BirthDate, Gender, CreateDate, CreatedBy
Value Object:
public class Person {
private String name;
private DateTime birthDate;
private int gender;
private DateTime createDate;
private int createdBy;
}
Business Layer Object:
public interface IPersonModel {
public boolean isTeenager();
public boolean isMale();
public boolean isFemale();
}
Presentation layer Multi Column List control
public interface ITableList {
public int rowCount();
public Object getItemAtRow(int row);
public Object getValueAtRowColumn(int row, int column);
}
public interface ITableItem {
public Object getValueAtColumn(int column);
}
The most complex part is storing in a database table which fields on
the value object will be presented in the multi column list control.
It needs to be user friendly and maintainable.
One time I tried having each value object with a switch statement for a
unique number for each field. So the database contents and source code
are kept in synch e.g. 266 in the database means 'Person CreateDate'
and the value object returns that when implementing ITableItem.
It worked but relies on a code generator to make it all work.
This time around I thought I could keep a script in the database so the
user would pick the first column to be person.getCreateDate(), the
second to be person.getName() etc.
Using reflection I could generate on the fly which attribute will be
displayed in which column.
Anyone think of other options?
The other thing I need to change is it seems an unecessary dependency
for the value object to implement ITableItem - there probably needs to
be another class which does it and depending on the database values
pulls the data from the value object.
The same goes for the value object implementing the business rules.
While probably not too bad if it does, perhaps mapping the values to
something that does might work better.
Apart from the value object I am trying to anything else in all the
code knowing about fields which are only used for CRUD e.g. createDate.
CreateDate may never be used for logic - in my app - ever - so why
pass it around as business objects - better to only have things
implementing interfaces where needed.
What do you think so far?
- 11
- Socket error Windows getInputStreamHello,
Java version is 1.5.0_09. I am trying to connect from a Windows
machine to another Windows machine using sockets . Getting a socket
error for the following line. and throws EOFException
Socket s = null;
ObjectInputStream sin = null;
ObjectOutputStream sout = null;
s = new Socket( host, port );
sout = new ObjectOutputStream( s.getOutputStream() );
//write data to socket
sout.writeObject( req );
sout.flush();
InputStream is = s.getInputStream() );
sin = new ObjectInputStream( is ); // This line gives error
If I step into ObjectInputStream, I see:
public ObjectInputStream(InputStream in) throws IOException {
verifySubclass();
bin = new BlockDataInputStream(in);
handles = new HandleTable(10);
vlist = new ValidationList();
enableOverride = false;
readStreamHeader(); // This line gives error
bin.setBlockDataMode(true);
}
However, the same code works when I try to connect from Linux(Red Hat
Enterprise Linux WS release 4 (Nahant Update 5)) to Windows. Turned
off Windows firewall but no luck.
On the Windows Server I am trying to connect to a server agent waiting
on port 2002 that helps me connect to Citrix running on that machine.
The agent runs as a Windows service.
What could be wrong here?
Stack Trace
java.io.EOFException
at java.io.ObjectInputStream
$PeekInputStream.readFully(ObjectInputStream.java:2228)
at java.io.ObjectInputStream
$BlockDataInputStream.readShort(ObjectInputStream.java:2694)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:
761)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
...
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
- 12
- Serial Port CommunicationsI have a java application that I wrote that collects data from a
serial port on a laptop from a data collection device. Program works
well.
My bosses would like certain conditions to draw more attention than
just using the laptop's monitor. They would like two lights and a horn
to be controlled as well.
Tackling the serial input device was pretty easy, but I am not sure
where to start with this request.
1) I only have one serial port on the Laptop, but they want to control
4 devices (horn, light 1, light 2, data collection device). So how
do I handle that?
2) Where would I go to buy the other devices and what device would I
have my java program talk to in order to control them?
Thanks,
Larry
- 13
- Advanced Tooltips in JavaHi
I want to implement dynamic interactive tooltips in java so that the
user can expand / collapse them. Also, if there are hyperlinks in the
tooltip text, the user should be able to follow up this link. For the
same purpose, I need to be able to catch any events associated with
tooltips.
I tried to search a lot on how to customize the behavior of tooltips in
Java, however couldn't find any useful information. Does anyone know
about how to proceed about this? Any suggestions / pointers would be
greatly appreciated.
Thanks,
Shraddha
- 14
- newbie with compilingHi
I am new to Java world, I download java version j2sdk1.4.1_01 to my
computer, and install it
when I try to compile program from command line type javac tst.java, I got
the following error
"Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/tools/javac/Main"
however, I can use textPad to compile it, when I try to run from textPad, I
got same error:
Thanks advance
Libin
- 15
- jni gcc mangled names//Crapo.java
public class Crapo {
static {
System.loadLibrary("Crapo");
}
native public static int magicNumber(int n);
public static void main(String... args) {
System.out.println(magicNumber(246));
}
}
//Crapo.c
typedef long long __int64;//gcc doesn't recognize __int64
#include "Crapo.h"
/*
* Class: Crapo
* Method: magicNumber
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_Crapo_magicNumber(JNIEnv * env, jclass c,
jint n) {
return 47;
}
//run gcc -mno-cygwin -Wl,--add-stdcall-alias -shared -o Crapo.dll -I
"C:\Program Files\Java\jdk1.6.0\include" -I "C:\Program
Files\Java\jdk1.6.0\include\win32" Crapo.c
//output of nm Crapo.dll
10003040 b .bss
10003020 b .bss
10003000 b .bss
//............ 30+ lines of this crap
1000505c i .idata$5
//..........................
100011d0 T _DllMain@12
10001000 T _DllMainCRTStartup@12
100011c0 T _Java_Crapo_magicNumber@12//<-----------------
10001360 T __CTOR_LIST__
10001368 T __DTOR_LIST__
U __RUNTIME_PSEUDO_RELOC_LIST_END__
U __RUNTIME_PSEUDO_RELOC_LIST__
//................... more crap; to me at least
//it was my understanding that --add-stdcall-alias when passed to the
linker should remove the @12 of _Java_Crapo_magicNumber@12
//run gcc -mno-cygwin -shared -o Crapo.src -S -I "C:\Program
Files\Java\jdk1.6.0\include" -I "C:\Program
Files\Java\jdk1.6.0\include\win32" Crapo.c
//remove @12 from Crapo.src
//run as -o Crapo.obj Crapo.src
//run ld -shared -o Crapo.dll Crapo.obj
//run nm Crapo.dll
U .bss
U .data
10001000 t .text
10001000 T _Java_Crapo_magicNumber
10001010 T __CTOR_LIST__
10001018 T __DTOR_LIST__
10002000 A __RUNTIME_PSEUDO_RELOC_LIST_END__
10002000 A __RUNTIME_PSEUDO_RELOC_LIST__
10001010 T ___CTOR_LIST__
10001018 T ___DTOR_LIST__
//... more crap
// by manually removing the @12 from the assembly source produced by
gcc and then separately assembling and linking solves the problem.
//I like the fact that their are far fewer unnecessary symbolic names.
Yet I was hoping their was a one step command-line option to be sent,
like --add-stdcall-alias? Any reason that doesn't seem to work for me?
//It's my understanding that -Wl,--add-stdcall-alias command-line
option is sent to the linker by gcc, and then subsequently sent to
dlltool where the option should result in the @nn's being removed from
the table of symbolic names. Is this correct?
|
|
|