| Consuming Web Services inside J2EE/ Jboss |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- Deploying java web services on TOMCATHi
I have build a web service using the tutorial given on sun's site
(http://docs.sun.com/source/817-2151-10/wsgjaxrpc.html). Web service is
deployed on J2EE application server and every thing is working fine.
Now i want to deploy the same web service on TOMCAT. First of all i
would like to explore about the possibility of doing the same. Is it
possible to deploy web service on java without using Soap admin tool
and AXIS.
Regards
Rohit
- 2
- help needed @ Taskbar dimensions (screen size- taskbar size)Hi All,
I'm bulding a stand-alone-java GUI application.
This application is expected to run both on Windows & Linux
The content of GUI window is self configration at run time with csv
file.
Now my problem is " how to set size of GUI application window"
java.awt.Toolkit.getDefaultToolkit() can get me user's full screen-size
but u never know about user's taskbar dimensions. it can be
vertical/horizontal/auto-hide.
How could I get the actual working area for my applciation
i.e. DIMENSIONS_OF_SCREEN_SIZE - DIMENSIONS_OF_TASKBAR
- 4
- Detect XP themeDear NG,
One simple question: How can I detect
whether a windows user uses xp theme
or windows classic?
TIA,
Jens
- 6
- JTable model's issueHi:
I have got a JTable and its cells are JPanel's (to make Java2D inside)
displaying numbers.
The problem is that I want the cells to be editable, so when you click on
the cell, you could write some number, and the new one be redisplayed.
I wrote a method called setValue() on the AbstractTableModel class which
updates the selected JPanel numerical value, but there is a little problem:
when you click a cell, you get a line full of info about the JPanel, so if
you want to enter a number, you have to clear the cell to avoid getting an
error.
so the question is, is there a way to avoid the info to get displayed? note
that my AbstractTableModel getValue() method needs to return a JPanel..
Thanks !!
--
PGR
- 6
- jdk-1.4.1 plugin & Yahoo ChatWell, now that the plugin is working w/ 1.4.1 (w/ p4) I decided to give it
a whirl. I upgraded the plugin Mozilla Firebird uses by changing the
symbolic link /usr/X11R6/lib/browser_plugins/libjavaplugin_oji to link to
/usr/local/jdk1.4.1/jre/plugin/i386/ns610/libjavaplugin_oji.so instead.
Sure enough, about:plugins showed 1.4.1 now instead of 1.3.1. So the first
place I decided to try was Yahoo Chat since I had the most quirks with it
and 1.3.1.
Right away, I start noticing new problems. I tried clicking on the black
box to choose a font color, and Firebird crashed. Then I tried
double-clicking on a name to get more info, and Firebird crashed again.
Both these actions normally pop up a new small window on top of the chat
session, so it seems like anything on Yahoo Chat that opens a new java box
crashes Firebird.
My other problem is, I can't seem to switch back to 1.3.1! I renamed
libjavaplugin_oji.so to libjavaplugin_oji.so.14 and created a new
libjavaplugin_oji.so link to point back to 131's ns600/libjavaplugin_oji
but even closing and restarting Firebird, about:plugins still shows 1.4.1.
Epiphany does the same thing. How to I switch back?
Glad to see the progress though. :)
- 7
- String ManipulationAlternatively, if you have the ability to change the XML, put them as
two separate fields in the XML. After all, the use of a comma is a
means of overloading the field.
On Jul 13, 8:57 am, "email***@***.com" <email***@***.com> wrote:
> Hey everyone, I have a string that is returned from an xml file as two
> coordinates for example 23.424242,42.13131 exactly like that with no
> spaces, what is a way to break it into two seperate integers?
- 8
- Spring and hibernate: all these jars?All,
just downloaded the latest spring RC. I've set up a super simple test, and
had to work through a lot of classpath issues, starting with just the
spring, logging, and hibernate jars and then adding jars to the classpath
until the errors went away. here's what i finally ended up with. Does this
look correct?
I'm not so much concerned about it if it's really what's needed, but I don't
want to run into conflicts and such down the road. So mostly i'm worried i
might have screwed something up. Here's what I have (from eclipse):
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/antlr-2.7.6.jar"/>
<classpathentry kind="lib" path="lib/c3p0-0.9.1-pre6.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-2.1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
<classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/ehcache-1.2.jar"/>
<classpathentry kind="lib" path="lib/hibernate3.jar"/>
<classpathentry kind="lib" path="lib/cglib-nodep-2.1_3.jar"/>
<classpathentry kind="lib" path="lib/jta.jar"/>
<classpathentry kind="lib" path="lib/jtds-1.2.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.13.jar"/>
<classpathentry kind="lib" path="lib/spring.jar"/>
- 9
- webpages on TomcatHi,
I am a JSP newbie. I installed apache tomcat on my PC. I can view all
the example JSP pages at http://localhost:8080/jsp-examples/. The files
themselves reside at C:\Program Files\Apache Software Foundation\Tomcat
5.0\webapps\jsp-examples.
So I created a html and a JSP page in C:\Program Files\Apache Software
Foundation\Tomcat 5.0\webapps\. but i can't seem to view them via http.
Am I missing something really fundamental here?
Any help will be greatly appreciated!
Eddy
- 13
- Bind to a specific interface
Hello:
One of my peers just asked if there is a way to
bind a socket to a specific interface on a dual
homed machine in a Java Application. I believe there
is but I cannot find this documented. Could someone
forward me a pointer to where this is described?
Thanks,Steve
- 13
- EncryptionSimple question... sorry..
I'm trying to encrypt a string with a private key (retrieved from
KeyStore - that I created using keytool). So that I can send the
public key to the client to decrypt the string.
The problem I'm having is (partially from the Java's Developer's
Almanac).
java.security.InvalidKeyException
at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)
at javax.crypto.Cipher.init(DashoA6275)
at DesEncrypter.<init>(DesEncrypter.java:24)
DesEncrypter(Key key)
throws InvalidAlgorithmParameterException, NoSuchPaddingException,
NoSuchAlgorithmException, InvalidKeyException
{
// Create an 8-byte initialization vector
// byte[] iv = new byte[]{
// (byte)0x8E, 0x12, 0x39, (byte)0x9C,
// 0x07, 0x72, 0x6F, 0x5A
// };
// AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
// CBC requires an initialization vector
24: ecipher.init(Cipher.ENCRYPT_MODE, key); //, paramSpec);
The "key" problem I'm having is that the code actually uses the
"SecretKey" to the class, but I'm retrieving a "Key" private key from
the store.
I know I'm missing something..
Ian
- 16
- Initialization order brain-damageHi y'all,
So after spending a particularly frustrating afternoon debugging
through constructors and browsing the Java Language Specification 3.0
in some detail, I have come to the conclusion that I actually know
nothing and need to ask a question:
What is the standard order of evaluation of expressions during object
construction w/rt constructors, super-constructors, and instance
variable initializers? Specifically with the code:
class A
{
AType a1 = new AType();
A() { aDoesSomething(); }
}
class B extends A
{
AnotherType b1 = new AnotherType();
B() { bDoesSomethingElse(); }
}
B bongo = new B();
when do all of the various bits get executed? If there's a section of
the language spec that tells me this, I would really appreciate the
pointer, as well...
david rush
- 16
- java based cell phone capabilitysPlease bear with me, am old and somewhat out of touch with
technology....
Is there a cell phone that can access an web page with an mp3 playing
applet and play mp3's downloaded from the web site.
Robert
- 16
- Notification ServiceHi all,
I'm using openORB.
How can I test if the properties EventReliability and PersistentRealiability
work? I have made my own channel, admin and proxy with these properties
but I don't understand how I can try them.
Thanks,
ReX
- 16
- How to separate interface from implementation when using JARs?Hi,
In an engineering world where I used to be working with C++ I am now
shiftnig to Java. In C++ I would publishe my interfaces in header
files. In Java I can use the interface concept.
However this is not sufficient for me. I want to be able to full
separate the implementation from the interface of e.g. a class method.
Example:
public interface MyMath {
- 16
- Appletee, Servletee kind of newbie question!Hi everyone,
I am having real problems working out whats going on w/ my applet. I want to
be able to send an object from an applet to a servlet, here is the code for
the listener method causing the trouble:
private void addClientListener(java.awt.event.MouseEvent evt) {
System.out.println("Got this far, addClientListener.");
try {
URL fileURL = new URL(getDocumentBase(),
"servlet/MaintSchedServ");
URLConnection conn = fileURL.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setRequestProperty("addClient", "true");
ObjectOutputStream out = new ObjectOutputStream(new
BufferedOutputStream(
conn.getOutputStream()));
out.writeObject(textField1.getText());
out.close();
} catch( Exception exc ) {
exc.printStackTrace();
}
}
I apologise if my usage of setRequestProperty is incorrect, i need to pass
several different objects to servlet and thought that by using this method
of URLConnection, i could evaluate this at servlet and handle each case
seperately. If there is a better way i would love to know how!
Here is the java console output, it is saying that i need to set doOutput =
true, well i am aren't I?
Thankyou in advance for any direction you can give me!!
Andrew.
Java(TM) Plug-in: Version 1.4.1_02
Using JRE version 1.4.1_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Andrew Tucker
/*
options
*/
Stopping applet ...
Unregistered modality listener
Joining applet thread ...
Destroying applet ...
Disposing applet ...
Joined applet thread ...
Quiting applet ...
Finding information ...
Releasing classloader: sun.plugin.ClassLoaderInfo@4865ce, refcount=0
Caching classloader: sun.plugin.ClassLoaderInfo@4865ce
Current classloader cache size: 1
Done ...
Registered modality listener
Referencing classloader: sun.plugin.ClassLoaderInfo@4865ce, refcount=1
Loading applet ...
Initializing applet ...
Starting applet ...
Got this far, addClientListener.
java.net.ProtocolException: cannot write to a URLConnection if
doOutput=false - call setDoOutput(true)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown
Source)
at AWTMaintSchedGUI.addClientListener(AWTMaintSchedGUI.java:114)
at AWTMaintSchedGUI.access$000(AWTMaintSchedGUI.java:17)
at AWTMaintSchedGUI$1.mouseClicked(AWTMaintSchedGUI.java:51)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
|
| Author |
Message |
SMMT

|
Posted: 2004-12-3 1:06:00 |
Top |
java-programmer, Consuming Web Services inside J2EE/ Jboss
Hi,
I have search the web , and by know I hava an good ideia on how to publish may Stateless EJB has a
webservice (using JBoss 3.2.x). My problem is now consume web services inside a Stateless EJB (or
any other , for that matter). I've searched, but with no luck. Having a WSDL file for a web service
how do I comsume it inside my beans ? (i.e. use the web service as an extension of my server
funcionality) How to I access that service from inside EJB using JBoss?
Any ideias ?
|
| |
|
| |
 |
Marek Lange

|
Posted: 2004-12-3 16:09:00 |
Top |
java-programmer >> Consuming Web Services inside J2EE/ Jboss
SMMT wrote:
> Hi,
>
> I have search the web , and by know I hava an good ideia on how to
> publish may Stateless EJB has a webservice (using JBoss 3.2.x). My
> problem is now consume web services inside a Stateless EJB (or any other
> , for that matter). I've searched, but with no luck. Having a WSDL file
> for a web service how do I comsume it inside my beans ? (i.e. use the
> web service as an extension of my server funcionality) How to I access
> that service from inside EJB using JBoss?
It is easy to make your EJB "webservice ready". There are differences
between 3.x and 4.x since JBoss4 is J2EE 1.4 certified. The JBoss docs
provide good examples for JBoss 4.x:
http://docs.jboss.org/jbossas/getting_started/startguide40/ws.html
For 3.x look here:
http://www.nsdev.org/jboss/stories/jboss-net.html
http://www.jboss.org/developers/guides/jboss.net/xdoclet
If your archive is deployed correctly you can see the wsdl in your
browser and test the webservice e.g. by using XmlSpy or any other
webservice client.
Hope this hepls.
-marek
|
| |
|
| |
 |
SMMT

|
Posted: 2004-12-3 17:57:00 |
Top |
java-programmer >> Consuming Web Services inside J2EE/ Jboss
Marek Lange wrote:
> SMMT wrote:
>
>> Hi,
>>
>> I have search the web , and by know I hava an good ideia on how to
>> publish may Stateless EJB has a webservice (using JBoss 3.2.x). My
>> problem is now consume web services inside a Stateless EJB (or any
>> other , for that matter). I've searched, but with no luck. Having a
>> WSDL file for a web service how do I comsume it inside my beans ?
>> (i.e. use the web service as an extension of my server funcionality)
>> How to I access that service from inside EJB using JBoss?
>
>
> It is easy to make your EJB "webservice ready". There are differences
> between 3.x and 4.x since JBoss4 is J2EE 1.4 certified. The JBoss docs
> provide good examples for JBoss 4.x:
The goal is not to make my EJB available using webservices, but, consum webservices inside EJB.
In other words, the goal is to make a Webservice Cliente inside the Application server that consumes
a web service provided by a 3tr-party (for wich I asume I have the WSDL descriptor), using an EJB
(say, a stateless bean that comunicates with a webservice, but that is not a webservice it self.)
Nervertheless, I apreciate the links and the awnser.
|
| |
|
| |
 |
Marek Lange

|
Posted: 2004-12-3 19:44:00 |
Top |
java-programmer >> Consuming Web Services inside J2EE/ Jboss
SMMT wrote:
> The goal is not to make my EJB available using webservices, but, consum
> webservices inside EJB.
> In other words, the goal is to make a Webservice Cliente inside the
> Application server that consumes a web service provided by a 3tr-party
> (for wich I asume I have the WSDL descriptor), using an EJB (say, a
> stateless bean that comunicates with a webservice, but that is not a
> webservice it self.)
Your EJB must then be exposed as a webservice client (Axis etc.). This
is nothing EJB specific.
-marek
|
| |
|
| |
 |
SMMT

|
Posted: 2004-12-12 5:39:00 |
Top |
java-programmer >> Consuming Web Services inside J2EE/ Jboss
Marek Lange wrote:
> Your EJB must then be exposed as a webservice client (Axis etc.). This
> is nothing EJB specific.
Any tutorial I can read on own to do that ?
|
| |
|
| |
 |
MarioB

|
Posted: 2005-2-15 1:03:00 |
Top |
java-programmer >> Consuming Web Services inside J2EE/ Jboss
Hi,
I've got the same problem like you. I also have to program an ejb that
acts as a consumer of a web service. I'm gonna use jBoss 4 and axis 1.1.
If you already have got a solution for the problem it would be fine if you
could give me some hints.
thanks
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Sun and MS java??I'm using XP SP1 and have both Sun and Microsoft java installed. They're both marked in Control Panel/Internet Setting/Advanced. Does that mean they're both active?
If one or the other has to be selected for my browser (IE) - how is that done? Sorry if the question sounds stupid, but this thing confuses me.
Thanks.
- 2
- @see tag"Adone Borione" <email***@***.com> writes:
> /**
> * @see java.lang.String
> */
You need to tell JavaDoc where the standard API docs are: By default,
JavaDoc doesn't include references to system classes because it
doesn't know where you may want to reference it.
- 3
- Tapestry disk usageHi all,
I am using a Tapestry based java solution. The solution has a HTML
front-end (as you would have expected) and a Postgres backend with
Tomcat as the server on a Windows XP machine.
Now when I login to my solution (You have to login using a username and
password) I have noticed that the system writes to the disk approx
6writes a sec (using services tool). When I dont log on and the system
is only displaying the GUI the system seems to be writing at about 4
writes/sec.
Now I am trying to cut down on the HDD writes. So can someone please
tell me as to why it is doing so many writes to the HDD even when its
only displaying the GUI and if there is any way for me to cut down the
writes/sec.
All help much appreciated.
Cheers.
- 4
- J2ME - loading big JPG files
"ab" <email***@***.com> wrote in message news:fppem0$u4c$email***@***.com...
>
>
> Hi,
> can anybody know how can I load and display large JPG files in J2ME?
>
> best regards ab
problem is with that is the memory capacity is quite low - so big jpgs with
throw errors - depends on how advanced the hardware is
- 5
- Create DOM from SAX streamI'm sorry if this has been incredibly overdone; I googled for a couple
minutes and couldn't come up with a definitive answer.
In my application I have the need to create a DOM from a stream of SAX
events. The way it currently works is that I instantiate an
org.apache.xml.utils.DOMBuilder on an empty org.w3c.dom.Document that
I've created from a JAXP DocumentBuilderFactory.
For the most part it works fine; all of the ContentHandler callbacks get
reported into the Document but only some of the LexicalHandler events
get reported.
Looking into the source for DOMBuilder I see that it tends to ignore
certain lexical events, mainly startDTD():
/**
* Report the start of DTD declarations, if any.
*
* Any declarations are assumed to be in the internal subset
* unless otherwise indicated.
*
* @param name The document type name.
* @param publicId The declared public identifier for the
* external DTD subset, or null if none was declared.
* @param systemId The declared system identifier for the
* external DTD subset, or null if none was declared.
* @see #endDTD
* @see #startEntity
*/
public void startDTD(String name, String publicId, String systemId)
throws org.xml.sax.SAXException
{
// Do nothing for now.
}
The DOMBuilder I'm using comes from the rt.jar under the 1.4.2_03 SDK.
I need these events to be fed back into the Document. Am I missing
something obvious here or will I need to extend the DOMBuilder and fill
in the gaps? Seems strange to me that would be left out.
Thanks for any help
Collin
- 6
- Question about JInternalFrame and MouseMotionListenerHi,
I've got a JInternalFrame containing several swing components : 2
JTabbedPane, a JToolBar and a panel with a ButtonGroup.
I've added a MouseMotionListener to the JInternalFrame.
The mouse moved is not detected when the mouse cursor stay inside one
of the component (for example in the JTabbedPane).
How can I make it work ? Is there another solution than to add a
MouseMotionListener to each component of the JInternalFrame ?
Thanks
Annie
- 7
- OT:News readers..so many to choose fromWell I've abandoned google groups for the time being and have switched
over to PAN on Linux and Gravity on Windows. What I am wondering is,
how hard would it be to write a news reader client in Java? I know it's
way beyond me, but there must be people reading this ng who have had
some degree of sucess at it. What was the process you went through to
design and build the program? How much practical experience would one
need to be able to sucessfully code such a program? If you know that
you need say, a class that will send a request to a news server, how do
you go about finding it in the API documentation? And if you don't find
one, do you write your own or simply extend one that is already there,
and is close to what you need? I have a book on OO Design coming, but
it would be interesting to know what others think. I know this is
pseudo-off topic, which is why I put the OT in the subject line. This
is my first post using Gravity so it may not work, but if it does, I
hope we can have a good discussion about this topic, if it hasn't
already been hash(tabled) before.
Cheers
- 8
- Bad performance of HTTPServletResponse at TomcatHi ,
I have a serious bad performance problem when under the load.
When I make a load test of 20 users, I see a bottleneck on the writing
of the response.
The lenght of the message up to 50K , but writting to outputstream
takes about 40 seconds.
Thanks in advance, Sasha
- 9
- Performance Q: java hotspot vs. native codeIn each of these two cases, would optimized C run substantially faster
than Java (hotspot or other JIT VM)?
* A number-crunching algorithm with a tight loop and a large number of
iterations (from
thousands potentially up to millions, or more) using doubles.
* Ditto, but with the C code using arrays of uints and carries to
effect a high precision
fixed-point math, and the Java code using BigDecimals.
* Ditto, but with roll-your-own Java BigDecimal-alikes using arrays and
math.
If there's an even higher performance option (short of compile-to-FPGA
:)) for the high-precision cases, please let me know about that as
well. (I know when it gets up into the 500+ digits it can be faster to
use FFT for the multiplies -- O(n log n) vs O(n^2). I'll cross that one
when I come to it.)
- 10
- Your 2 cents: Java Generics, love it, hate it, or waiting?email***@***.com opalinski from opalpaweb <email***@***.com> wrote:
> I was of something else: If you have sources that were written before
> 5.0 you can write new classes which use generics and have data flow
> between instances of previously written classes and generics using
> classes.
It would, of course, be possible to do this without type erasure as
well, in exactly that set of circumstances where it's safe, by giving an
appropriate definition of raw types. When it's not safe, you could
provide trivial wrappers (much like the current Collections.checkedList,
except without its stupid Class<E> parameter; see earlier post) that
would fit the necessary API and cast at run-time. The result would be
better than what we have now.
> If you have classes B,C,D which use class A internally, where class A
> is a container. You then modify A to be a generic, paramterizable on
> Classes. The change to A does not break B,C,D. B,C,D can stay excalty
> as they were even though the container they use internally has changed
> to be a generic.
Assuming the result only has to run on Java 1.5, this doesn't require
type erasure. And since Java 1.5 produces a new class file version
number, even the current implementation doesn't save you from that,
anyway.
So you just define the raw type, as used in the old source and binary
code, as being equivalent to what we now call the type erasure of the
type, and voila! Everything works.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
- 11
- 12
- Eclipse memory setting and other tricksHi,
1-
First, don't give eclipse more heap, because it doesn't need it, or at least don't give too much.
If you give a JVM more heap, IT WILL GRAB IT, but only to pile more garbage
and the Full GC will just take longer, especially because it must swap in
from virtual memory before being able to run finalizers if any.
The reason why you feel it works better, is because it fullgc's less frequently.
The only bug is the JVM that doesn't release unused heap yet. (maybe jdk 1.5...)
Write a small program that invokes the elipse main and give
yourself a way to invoke System.gc() (ui button, read stdin for "gc", whatever...)
and report the time it took, and the before/after memory used/free/total (see java.lang.Runtime)
The reason I suggest that, is to monitor in how much heap eclipse really fits in.
If you gc and never sees more that 30 megs. you should be fine with the default 64 meg.
See ExtraSimpleConsoleDebugger.java below.
Feel free to add commands like listing threads, system properties, current time, etc...
2-
Do not minimize your eclipse window. What?
Yes that's right. Windoze has this bad habit, although some think it's nice,
to schedule parts of a foreground app memory for swap out to paging file as soon as minimized.
If you keep eclipse running over night, you know what I mean...
If you got the GC trick above, leave the eclipse window minimized overnight and
without restoring the window, invoke gc when coming in the morning.
You should get 1-3 minutes GCs! (it is swapping in). (2nd tip: close eclipse everyday...!)
Another trick during day is to keep eclipse de-maximized but not minimized, in a window that I
resized to barely have the title bar, and I toss it in a corner.
This way, it is not swapped out, and you can totally see your desktop.
Kind of like those new window manager, that rolls up windows in a thin bar.
3-
Hotspot jit compiled code takes place too! If eclipse has been running for hours, it
is then fairly jit compiled. The default jit threshold is 1500 invocations. So the trick,
(if you worry about ram but not CPU) is to disable the JIT, or set the threshold very high.
(-Xint to disable, or -XX:CompileThreshold=####)
On the opposite, if you want performance and got plenty of ram, set it lower.
But 1500 is fairly low already. Just remember that JIT compiling take a bit of extra time also,
So a too-low threshold will slow down even more the startup.
4-
GC options.... I tried so many, but frankly, on a single CPU, you can't do much tuning.
You can try. Maybe your hyperthreaded CPU on winXP will kick in and give good results...
5-
Here is my eclipse launch batch file:
fyi: I just update my eclipse by copying my workspace folder to the freshly unzipped eclipse sdk.
At first run, it converts anything it has to, and recreate the .config/ folder, and exits.
Don't worry, you run eclipse a 2nd time. That double start is invisible when you use eclipse.exe.
Hope this helps.
(And I hope your reader doesn't wrap lines...)
----------------------------------------------------------------
@echo off
rem set idepath=C:\java\eclipse_3.0_i20030806
rem set idepath=c:\java\eclipse_3.0_i20040106
rem set idepath=c:\java\eclipse_3.0_i20040121
set idepath=c:\java\eclipse_3.0M7
rem set idepath=C:\java\eclipse_3.0_i20040226
rem ----------------------------------------
rem set jvmpath=C:\java\j2sdk1.4.1\bin
set jvmpath=C:\java\jdk14\bin
cd /d %idepath%
set jvm=%jvmpath%\java.exe -showversion
rem set memoryspec=-Xms32m -Xmx128M -XX:NewRatio=8 -XX:SurvivorRatio=4
rem set memoryspec=-Xms32m -Xmx64M -XX:NewRatio=8 -XX:SurvivorRatio=4
rem set memoryspec=-Xms32m -Xmx96M
rem set jitspec=-XX:CompileThreshold=10
rem set jitspec=-XX:CompileThreshold=5
set jitspec=
rem set gcspec0=-verbosegc -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -XX:+DisableExplicitGC
set gcspec0=-verbosegc
rem (throughput) UseParallelGC
rem set gcspec=-XX:+UseParallelGC
rem (low pause concurent) concurent mark-sweep
rem set gcspec=-XX:+UseConcMarkSweepGC
rem (low pause concurent) concurent mark-sweep with concurrent remark
rem set gcspec=-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled
rem (low pause concurent) concurent mark-sweep with concurrent remark with defrag oldgen
rem set gcspec=-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection
set gcspec=
rem ------------------------------------------
@echo on
%jvm% %memoryspec% %jitspec% %gcspec0% %gcspec% -cp %idepath%\startup.jar org.eclipse.core.launcher.Main org.eclipse.ui
@echo off
rem With commandline/UI tool (to run GC and get memory stats):
rem %jvm% %memoryspec% %jitspec% %gcspec0% %gcspec% -cp c:\java\prog\tools.jar;%idepath%\startup.jar ExtraSimpleConsoleDebugger -is 2222 org.eclipse.core.launcher.Main org.eclipse.ui
----------------------------------
import java.io.*;
import java.lang.reflect.Method;
import java.net.*;
public class ExtraSimpleConsoleDebugger {
static String EOL = "\r\n";//System.getProperty("line.separator");
private PrintStream cd_ps_out = null;
public ExtraSimpleConsoleDebugger(PrintStream output) {
cd_ps_out = output;
}
void gc() throws Exception {
memInfo();
long t1 = System.currentTimeMillis();
System.gc();
long d = System.currentTimeMillis() - t1;
cd_ps_out.println("System.gc(): "+d+" ms");
memInfo();
cd_ps_out.flush();
}
void memInfo() throws Exception {
Runtime r = Runtime.getRuntime();
long f = r.freeMemory();
long t = r.totalMemory();
cd_ps_out.println("USED=" + (t - f)/1000 + "k, FREE=" + (f/1000) + "k, (TOTAL=" + (t/1000) + "k)");
cd_ps_out.flush();
}
public static void main(String args[]) throws Exception {
if(args.length<1) {
System.out.println("Arguments:");
System.out.println(" [-is <port>] [classname [std arguments]]");
System.out.println("where:");
System.out.println(" port tcp port to start input server on");
System.out.println(" classname classname on which the main(String[]) method will be invoked");
System.out.println();
}
String classname = null;
String[] arguments = null;
int isport = 0;
int i = 0;
while(i<args.length) {
if(args[i].equals("-is") && args.length >= (i+1)) {
isport = Integer.parseInt(args[i + 1]);
i += 2;
} else {
classname = args[i];
arguments = new String[args.length - i - 1];
for(int j = 0; j < arguments.length; j++) {
arguments[j] = args[i + j + 1];
}
break;
}
}
if(classname!=null) {
if(isport>0)
ExtraSimpleConsoleDebugger.startInputServer(true, isport);
invokeMain(classname, arguments);
} else if(isport>0) {
System.out.println("---TEST MODE---");
ExtraSimpleConsoleDebugger.startInputServer(false, isport);
}
}
public static void startInputServer(boolean daemon, int port) {
CommandInputServer cis = new CommandInputServer(port);
cis.setDaemon(daemon);
cis.start();
}
static void invokeMain(String className, String[] sa) throws Exception {
if(sa == null)
throw new IllegalArgumentException("String[] cannot be null");
Class c = Class.forName(className);
Class saClass = (new String[0]).getClass();
Class[] ca = new Class[]{saClass};
Method m = c.getMethod("main", ca);
m.invoke(null, new Object[]{sa});
}
//============================================
// INNER CLASSES
//============================================
static class CommandInputServer extends Thread {
private int cnt = 0;
int port;
ServerSocket ss;
CommandInputServer(int port) {
super("CD-InputServer:" + port);
this.port = port;
}
public void run() {
try {
ss = new ServerSocket(port);
while(true) {
Socket s = ss.accept();
InputSession is = new InputSession(this, cnt++, s);
is.start();
}
} catch(Exception e) {
e.printStackTrace();
} finally {
try {
ss.close();
} catch(Exception e) {
}
}
}
}
static class InputSession extends Thread {
CommandInputServer cis;
Socket socket;
int sessionNumber;
InputSession(CommandInputServer cis, int sn, Socket s) {
super("CD-InputSession[" + sn + "]:" + cis.port);
this.cis = cis;
this.sessionNumber = sn;
this.socket = s;
}
void help(PrintStream ps) {
ps.println();
ps.println("gc : run System.gc()");
ps.println("m : show memory info");
ps.println("endserver : ends the Session creator server (on accept port)");
ps.println("q : quit this session");
}
public void run() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintStream ps = new PrintStream(socket.getOutputStream(), true);
ps.println();
help(ps);
ps.print(getName() + ">");
ps.flush();
ExtraSimpleConsoleDebugger cd = new ExtraSimpleConsoleDebugger(ps);
for(String line = br.readLine(); line != null; line = br.readLine()) {
String trimmed = line.trim().toLowerCase();
ps.println(trimmed);
if(trimmed.equals("?")) {
help(ps);
} else if(trimmed.equals("gc")) {
cd.gc();
} else if(trimmed.equals("m")) {
cd.memInfo();
} else if(trimmed.equals("endserver")) {
cis.interrupt();
cis.ss.close();
} else if(trimmed.equals("q")) {
break;
} else if(trimmed.length()>0){
ps.println("Unknown cmd: "+trimmed);
}
ps.print(getName() + ">");
ps.flush();
}
br.close();
ps.close();
socket.close();
} catch(Exception e) {
e.printStackTrace();
}
}
}
}
- 13
- fulltext is on?Hello,
Is there a way to know if a column is fulltext or not? I use a mysqld with
the java jdbc.mysql driver.
Tom
- 14
- GUI API for Micro DevicesI was searching around on the Java Micro Edition docs for something about
designing a GUI for micro devices (four buttons, small LCD screen size,
compact widgets). Couldn't find anything on SUN's site, mostly due to too many
links probably.
Could someone point me to some API Docs for Micro Edition GUI stuff? Or if no
such thing exists for Sun, is there a commonly used widgets API somewhere
else?
- Brian
- 15
|
|
|