| Error passing Element to web service |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- OutOfMemory and Swap SpaceI have this strange issue with an Out Of Memory error thrown on a Sun
JVM 1.4.1 residing on a Windows 2000 box.
The Windows boxes is configured to have 4 GB physical RAM out of which
2 GB is available to applications on their server. ( Based on this
article at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/4gt_ram_tuning.asp
)
Out of this 2 GB , we have 3 JVMs of heap size at 768 M. Thich means a
total of 2034 Megs allocated only to Java processes implying a 2048 -
2034 = 14 Megs left for other applications and most importantly swap
space.
I have -verbose:gc logs that tell me that initially a couple of full
GCs happen followed by a monotonically increasing scavenges and just
before the OOM some hectic full GCs happen apparently to reclaim some
memory but never do.
How important is the consideration of Swap Space in troubleshooting
such an error. Since this is a production environment, I just wanted to
have an idea before I go ahead and recommend a decrease in the heap
sizes for this environment.
Your assitance is greatly appreciated.
-Paddy
- 1
- Render .eps in swingDoes anyone have any information on how i would go about rendering .eps
files in swing, whilst preserving the "vector/scalable" property of them?
best regards
Costas
- 2
- JTree sorting ...Is there a simple way to sort tree nodes either by the JTree or its model ?
I can't seem to find anything on the subject.
Thank you in advance,
Benoit
- 4
- java 6 used in large companies?hi..
we are a large company considering the move from java 1.4 to either 5
or 6.
at the same we are upgrading to was6 (or maybe jboss 4), we are
interested to learn if there are any major projects on enterprise
level involving java 6 (including the use of it's web services
framework).
- 6
- Blowfish hashDoes anyone know how to do a Blowfish hash in Java? I need
to hash a password
- 8
- put application on server ??!!!!I have developed a java application that can return shortest path by
inputting data.
I would like to integrate this application into web application by putting
into tomcat server so that client can use the application through the
internet.
I am new to web service programming and I just start to learn jsp. I would
like to ask how I can do such implementation?
make my application into a bean ? and use the bean?
Please give me advice and help or references ..
Thousands thanx
- 8
- Question about Naming ServiceHi everybody,
SITUATION. Two machines with JacORB: each runs a servant of mine.
PROBLEM. I need the two servants to share the same Corba NameServer so
that they can interact.
I tried to run the JacORB naming service on both machines but, at my
best, I get two separate corba "domains" (say, the two servants can't
see each other).
Any tips or documentation or demos about it?
I would appreciate anything, even if from other ORBs.
Thankyou.
- 8
- Hibernate305: delete query fails with "must begin with SELECT or FROM"I'm using Hibernate 3.0.5, JDK 1.4.2, and Oracle 9i.
I'm following the Hibernate 3.0.5 docs to build a query to delete rows
from a table. My code looks something like this:
-----------------
String hql = "delete ReqField " +
"where fieldName = :fieldName and value
= :value";
Query query =
sessionFactory.getCurrentSession().createQuery(hql);
query.setString("fieldName", fieldName);
query.setString("value", value);
int deletedRows = query.executeUpdate();
-----------------
This fails with:
org.hibernate.QueryException: query must begin with SELECT or FROM:
delete [delete ReqField where fieldName = :fieldName and value
= :value]
What is wrong with my query?
- 11
- Repainting and threading - the eternal problem...Hi there folks!
I have a program, with MANY lines of code, so I will not post the
entire program here. However, this is my problem.
I have a GUI program based on swing which contains a JList:
===
this.userTrapList = new JList(this.userTrapListModel);
this.userTrapList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
this.userTrapList.setLayoutOrientation(JList.VERTICAL);
this.userTrapList.addMouseListener(this);
this.userTrapList.setCellRenderer(new MyCellRenderer());
===
As you can see, I also have a custom cell render called
MyCellRenderer:
===
private class MyCellRenderer extends DefaultListCellRenderer {
public static final long serialVersionUID = 1L;
public Component getListCellRendererComponent(JList list, Object
value,
int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list,
value, index, isSelected, cellHasFocus);
TSListObject tsl = null;
try {
tsl = (TSListObject)value;
} catch (ClassCastException cce) { }
if (tsl != null && tsl.hasBeenSent()) {
// if tsl has been sent, set background.
label.setBackground(hasBeenSentColor);
}
//// HERE I LEFT SOME CODE OUT ////
return label;
}
}
===
One of the features of the cell renderer is that, once a TSListObject
(which is what the JList contains) flag "hasBeenSend" is true, the
background color is set to green.
What the program does it iterates over the items of the list and sends
them. The class which sends them implements runnable, and here is how
I send them:
===
Enumeration<TSListObject> en = this.userTrapListModel.elements();
while (en.hasMoreElements()) {
TSListObject tmpTSL = en.nextElement();
/* THIS IS WHERE THE SENDING HAPPENS! */
SnmpPDU pdu = tmpTSL.getSnmpPDU();
TrapSenderModel ts = new TrapSenderModel(pdu, session,
dstHost.getText(), spinnerInt.intValue(), new Debug(1));
ts.addObserver(this);
Thread tsThread = new Thread(ts);
tsl.setHasBeenSent(true);
tsThread.start();
try {
tsThread.join();
Thread.sleep(500);
} catch(InterruptedException ie) {
//Catch nothing
}
}
===
As you can see, the actual sending happens when TrapSenderModel's
method run() is executed, which is the same as tsThread.start();
The TrapSenderModel extends Observable and every time it does
send(pdu) (which is not displayed here), it setChanged() and
notifyObservers(pdu).
In my GUI program, which implements Observer, I have an update()
method:
===
public void update(Observable obs, Object obj) {
System.out.println("Update caught!");
this.userTrapList.repaint();
}
===
Okey... Now that we've got the background covered, lets get down to
the problem:
If my JList contains 9 items, and I send them all, the output to
System.out is a nice print of "Update Caught" every 500 milliseconds,
HOWEVER, the background color of the labels do not update until all
items have been sent.
I would like the background of each cell to change momentaneously, as,
if we have a 0.5 second wait between sending every item, and we send
100 items, that means 50 seconds of not showing any change. This will
probably make the user impatient or worried.
I haev tried several methods to get this working, however, I did never
become best friends with SwingWorker and such....
I'm just thinking that, since the sending happens in a thread of its
own, why cannot the GUI update in its own native thread?
What have I missed? I've spent the entire day here and havn't come up
with anything!
I'm greatful for any help I can get (and yes, I've read manuals,
articles, forums, google and so on).
Yours,
Jonas
- 11
- hot java"hot java" sounds so...pornographic? larcenous?
anyhow, suns "hot java browser" is end-of-life, or whatever. I've poked
around a bit and found jazilla, some sort of "ice" java..
anyone use these, or other browsers written in java?
- 12
- how to determine when a servelt will unload????Hi -
I have a webpage that utilizes a servlet (written in JBuilder 7 and is
ran under Tomcat 4.0)...is there a way to find out how long of an idle
time is allowed (no calls to the servlet from the client) before the
servlet will be unloaded by Tomcat? And if I can find this out, can I
set this value somehow.
I have tried using the session.setmaxintervaltime but that does not
seem to work.
I would like to be able to kill the servlet after some set amount of
time so that I can run some code in the servelts destory method.
Thanks
- 15
- Can't reinstall Tomcat webapp because of log4j.properties lockedI've got a webapp that uses log4j for logging. The log4j.properties
file is in the classes directory of the application. Logging works
fine.
Problem is when I try to (using ANT) redeploy the application. This
first removes the application then installs a new jar.
It appears that Tomcat is unable to remove the log4j.properties file
because it is "in use". (The application has been stopped at this
point). So the new install fails until I manually restart tomcat at
which point the properties file can be deleted and all works fine.
Any ideas of how I can get Tomcat to "release" the properties file.
Is this a bug in log4j = not closing properties file after reading it?
- 15
- enum: display elements of an enum specified at runtimeHello,
I have the following problem:
I need to perform validation on an input parameter that is a String.
This String has to be one of the values of an enumeration.
The problem is that the enumeration type is not known until runtime - thus
the caller tells me that the concerned enum by specifying its full
qualified name.
e.g.
boolean validateStringOnEnum( String toTest, String
enumFullQualName);
Does anybody know what the code would look like?
Cheers!
- 15
- Parsing a test fileI'm pretty new to Java and have been assigned to parse a log file.
The file is tab delimited. I have several tokens that I need to look
for. I have to find all the rows that have "290" then check a column
within that row. That value must match a pattern. The pattern will be
stored in a db table, so the user can add muliple patterns. That item
will then be placed in a new file.
A good example would be awesome.
Thanks.
- 15
- How to render a JCheckBox on cells of JList?I do it like this:
public class CheckBoxCellRenderer extends JCheckBox implements
ListCellRenderer {
public CheckBoxCellRenderer() {
super();
}
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
if(isSelected)
{
this.setForeground(java.awt.Color.BLUE);
}
this.setEnabled(isSelected);
this.setText("Hello");
return this;
}
However, there is a problem: I can not select or disselect those check box
rendered in the JList.
What wrong?
Thanks.
MaoXuePeng.
|
| Author |
Message |
chrsty_a

|
Posted: 2005-6-17 3:38:00 |
Top |
java-programmer, Error passing Element to web service
I'm upgrading from WebLogic 6.1 to WebLogic 8.1 SP 4.
We used to specify weblogic.soap.http.SoapInitialContextFactory and
weblogic.soap.encoding.factory to lookup the web service in the client.
Well, the SoapInitialContextFactory and CodecFactory classes are no
longer around. So now I've used clientgen to generate the stubs and
here is my client code:
MyWebService service = new MyWebService_Impl(wsdlurl);
MyWebServicePort port = service.getMyWebServicePort();
Element result = port.processIt(theElement);
However, I get the following error calling processIt:
java.rmi.RemoteException: web service invoke failed:
javax.xml.soap.SOAPException: failed to serialize interface
org.w3c.dom.Element weblogic.xml.schema.binding.SerializationException:
Failed to serialize Document due to the following error
weblogic.xml.stream.XMLStreamException: The local name of an attribute
cannot be null
...
Caused by: weblogic.xml.schema.binding.SerializationException: Failed
to serialize Document due to the following error
weblogic.xml.stream.XMLStreamException: The local name of an attribute
cannot be null
at
weblogic.xml.schema.binding.internal.builtin.DocumentCodec.serialize(DocumentCodec.java:76)
...
Here's the schema and xml file:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://myproject.org/myproject_test.xsd"
xmlns:myproject_test="http://myproject.org/myproject_test.xsd"
elementFormDefault="qualified">
<element name="TEST">
<complexType>
<sequence>
<element ref="TEST_ID"/>
</sequence>
</complexType>
</element>
</complexType>
<element name="TEST_ID" type="string"/>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<TEST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://myproject_test.xsd"
xsi:schemaLocation="http://myproject.org/myproject_test.xsd"
file:///N:/myproject/metadata/myproject_test.xsd">
<TEST_ID>ABCD1234</TEST_ID>
</TEST>
I've been testing with this bare minimum schema so that I can change
the namespaces and other things easily. The one and only thing that's
made a difference is when I take out the namespace stuff from the xml
file, it does get sent to the server. I.E.:
<?xml version="1.0" encoding="UTF-8"?>
<TEST>
<TEST_ID>ABCD1234</TEST_ID>
</TEST>
However, I can't leave it like that because the server doesn't know
what to do with it. Also, when the server tries to send the response,
it gets the same error as above.
weblogic.xml.stream.XMLStreamException: The local name of an attribute
cannot be null
at
weblogic.xml.babel.adapters.DOMAdapter.adaptAttribute(DOMAdapter.java:113)
at
weblogic.xml.babel.adapters.DOMAdapter.adaptElement(DOMAdapter.java:147)
...
javax.xml.soap.SOAPException: failed to serialize interface
org.w3c.dom.Element weblogic.xml.schema.binding.SerializationException:
Failed to serialize Document due to the following error
weblogic.xml.stream.XMLStreamException: The local name of an attribute
cannot be null
The web service also returns an Element, but it's a different type from
a different schema, which I haven't touched. So the server is having
the same problem as the client.
If I change the web service to receive and return only strings, it
works fine. But I haven't been able to figure out why it won't work
for the Element. Does this sound like a problem with my WebLogic
configuration, the schemas/xml files, the web service, the client? Is
there a way to tell what attribute it is complaining about?
Thanks,
Christy
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Response cache on the application serverIs it a good thing to cache the search result?
The metadata for our system can be as much as 100,000
I am trying to enable the response cache on the web server.
However, I am thinking about the problem i might meet.
When you cache the search result, is it possible the other
person throw the same condiiton and see the same result?
With our system there some security set for each row, so
if this happens there is a security leak.
MD
- 2
- Forcing swing gui to be drawnHey, right now I have a program that analyzes an EKG when a button is
clicked. I want to pop up a progress bar in a new frame to show how far
it is, but I'm having problems. I can create the frame, and it will
appear, but it won't draw the progress bar until it is done executing
all of the other commands.
I ahve tried opening the frame with a separate thread, but it resulted
in the same problem. I guess there must be some draw queue that is on a
low priority, but I really have no idea why it isn't working.
Any help would be great... I show this at a science fair in 2 days.
Thanks!
-Thomas
- 3
- encrypted source file support in jdk?Hi
I an wondering if anybody knows if its possible to extend the
functionality of the sun java compiler/vm in jdk6, with for example
plugins or similar? or if the jdk supports something similar already?
What I am looking for is to set up a jdk environment where the source
code is ecrypted at the file level. This requires javac to be able to
en-/decrypt the source files. For further protection, the jvm would need
such support as well.
some details:
To answer the typical question first. For this scenario I am not
interrested in encrytpted filesystems, because it still leaves the
files vulnerable as long as the filesystem is mounted. The secrecy of
the files can still be compromised from hacking, virus, trojans, skype,
xss and all other sorts of system hacking. With encrypted files the
information in the files are still protected, even in the case a trojan
sends a file by email to somebody on the internet. Enctrypted
filesystems only help protect the integrity of the local system and the
disk while the system/disk is not running. Encrypted files help protect
the information during use as well.
I know there are many other issues as well, I'll be working throuhg it.
here is the list of the issues of most importance:
- en-/decryption support in
- ide / editor
- compiler
- code searching tools
- disassembler/debugger
- remove excess information from class files
- how to handle static content files
- html, css, jsp, configuration files for libraries and frameworks etc
- if class files are also encrypted
- en-/decryption support in the jvm runtime, covers tomcat, jboss etc.
- possible encrypted jar/war/ear files etc
- debugger
- information about classes must also be protected from prying
eyes who have obtained the class files and using the debugger to get
information.
- 4
- JMF video frame sizeI need to know dimension of the media file played by
javax.media.bean.playerbean.MediaPlayer
I use the code you can see below:
FormatControl formatControl = (FormatControl)
this.mediaPlayer.getControl ("javax.media.control.FormatControl");
VideoFormat videoFormat = (VideoFormat) formatControl.getFormat();
return videoFormat.getSize();
mediaPlayer is known object from another class.
But I get formatControl == null.
It's very very strange, but just one time this code did work.
So I have no idea ... Someone else?
- 5
- URL in IFRAMELet's say I have a struts action at http://xyz.com/someAction.do and this
URL is referred from one IFRAME via "src" attribute of IFRAME. Is it
possible for me to detect inside someAction.do which page is embedding it in
an IFRAME? How can I do this?
et me put question in a different way, if I refer to Google API with this -
code:
------------------------------------------------------------------------------
<script
src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAHuQre3TX-ZKoHs97iqelnBQn09xNixTqt4LnUZ12n-xJURxIHRRdLvNa4xtUwCJO0gkyTjCSRjfctQ"
type="text/javascript">
------------------------------------------------------------------------------
How does it know that the request is coming from domain xyz.com? It is not
purely based on the key - if I send same key from another domain, it doesn't
work! So how can I do that? Which header do I use? The referer header is
returned as null!
- manish
- 6
- What is a type error?Marshall <email***@***.com> wrote:
> David Hopwood wrote:
> > Marshall wrote:
> > > Mightn't it also be possible to
> > > leave it up to the programmer whether a given contract
> > > was compile-time or runtime?
> >
> > That would be possible, but IMHO a better option would be for an IDE to give
> > an indication (by highlighting, for example), which contracts are dynamically
> > checked and which are static.
> >
> > This property is, after all, not something that the program should depend on.
> > It is determined by how good the static checker currently is, and we want to be
> > able to improve checkers (and perhaps even allow them to regress slightly in
> > order to simplify them) without changing programs.
>
> Hmmm. I have heard that argument before and I'm conflicted.
>
> I can think of more reasons than just runtime safety for which I'd
> want proofs. Termination for example, in highly critical code;
> not something for which a runtime check will suffice. On the
> other hand the points you raise are good ones, and affect
> the usability of the language.
There doesn't seem to be a point of disagreement here. Programmers
often need to require certain properties to be checked at compile-time.
Others could go either way. There is no property that a program would
rationally desire to *require* be checked at runtime; that would only
occur because the compiler doesn't know how to check it at compile time.
--
Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation
- 7
- 8
- A basic tomcat questionHi gang, Tomcat's not my area of expertise but I have to get some simple
things set up -- nothing fancy.
I'm having trouble getting classes & packages to work. The setup is Tomcat
5.5.4 & JDK1.5. I can get basic servlets and JSPs to work, but I'm having
trouble with user classes and packages. Here's an example:
tomcat\webapps\ROOT\Test\TestMovie.jsp
----------------------------------------
<#@ page import="testpackage" @>
<html>
<body>
<% Movie m = new Movie("Gone With the Wind", 1936, 19.95); %>
<%= m.title %>
</body>
</html>
tomcat\webapps\ROOT\Test\WEB-INF\classes\testpackage\Movie.java
-------------------------------------------------------------------------
package testpackage;
public class Movie
{
public String title;
public int year;
public double price;
public Movie(String title, int year, double price)
{
this.title = title;
this.year = year;
this.price = price;
}
}
I've googled this & read the documentation, everything seems to say put all
the classes in packages, create a folder for the package under
WEB-INF\classes, and put the class files in the package folder, and that
should do the trick. But I must have something else missing. Any ideas?
Also, I don't know if this is related, but is there a trick to using new
featured of Java 1.5 in a JSP? I can't get the following JSP to compile:
<%@ page import="java.util.*" %>
<html>
<head>
<title>You're breaking my concentration.</title>
</head>
<body>
<% ArrayList<String> s = new ArrayList<String>();
%>
</body>
</html>
It complains about the first < in the scriptlet. Does that have to be
escaped somehow?
TIA,
--D
- 9
- Bound Threads (Re: Process vs Thread: what are the consequences?)On Tue, 13 Nov 2007 16:04:12 +0000, Kenneth P. Turvey wrote:
> Just based on some experimentation I was doing, this doesn't seem to be
> true. I'm running Linux with the Sun JVM, and it didn't map each Java
> thread to a native thread until the Java thread was spending enough time
> executing. I was actually trying to get this mapping (1 to 1) and found
> it impossible to guarantee under Linux with the Sun JVM.
>
> Under Solaris there is the -XX:UseBoundThreads (or something similar) to
> get that behavior, but under Linux no such option exists.
>
> I will freely admit that my experiment could have been flawed, but it
> wasn't behaving as if it was using more than a single native thread. I
> suspect that the article above is out of date.
I hate to followup my own post, but I've been looking at this problem
again and I'm really just unhappy with how it works. Since this can so
easily be solved under Solaris, and Lew (I think?) mentioned that this is
all JVM dependent. I was hoping somebody could point me to a JVM that
runs under Linux that supports the -XX:UseBoundThreads option or something
similar. I want a 1:1 mapping between native threads and Java threads and
I just can't seem to get it.
Does anyone have any idea? (BTW, I checked IBM's JVM).
--
Kenneth P. Turvey <email***@***.com>
- 10
- US-CA: Senior Software Engineers (Java) wanted Immediately!Cataphora is an award winning software company providing technology and
services for high end litigations and investigations. Its customers
include Fortune 500 companies, governmental agencies, and top American
law firms. We pride ourselves on having been funded from the start
entirely by revenues, with no venture capital investment. At Cataphora,
your creativity and versatility will be focused on a wide variety of
software development challenges and developing cutting-edge algorithms
for analyzing very large datasets. We are more than 80 people strong,
and continue to grow our employee-owned San Francisco Bay area company
by providing superior technology to meet the needs of our customers.
This is an excellent growth opportunity for the right candidate in a
rapidly growing, self-funded pre-IPO start-up.
Required Skills
- At least 4 years experience dealing with middleware or enterprise
software applications
- 3 years of Java experience
- Strong analytical and problem solving skills
Desired Skills
- Strong database experience
- Demonstrated ability to develop algorithms for solving complex
problems
- Development experience with a web-based application using J2EE
technologies
To apply, please send your resume (inline preferred; RTF, Word Doc or
PDF otherwise) to: email***@***.com - subject: "EU-DE-M09".
If you have any questions, feel free to contact me:
email***@***.com
Regards,
Markus Morgenroth
- 11
- How to convert Java class to exe files for performance?I have developped a java application (no awt involved) for my school research.
It's basically a scientific calculation program, which has huge loops.
Now it's very slow to run it in java/JIT.
I'd like to know if there are some existing free program to translate java
code(or class) to C code(or exe) since rewrite my code in C will take too long.
Has anyone used samilar converter before? Any suggestion is appreciated.
Thanks,
Wei
- 12
- 13
- Java Native Interface - passing parameter array of different datatypesGreets!
Yesterday I googled for hours to find a tutorial how to call Java
methods from C++ native code. Unfortunately I didn't find anything
useful, the Java JNI documentation doesn't capture the functionality
of the JNI very well.
I want to do the following: I want to call a Java method from C++
code. The Java method has some parameters of different datatypes, like
public static boolean dosomething(int x, long y, String z)
for example. Is there any way to do this? The Call...Methods() take
the method ID and an array of parameters to pass to the function, but:
HOW TO CREATE AN ARRAY OF DIFFERENT DATATYPES???
It's only possible to create a new array calling something like
NewObjectArray() when passing a datatype given.... I think, the only
way to pass parameters of different datatypes from C++ to Java methods
is to create a new class containing all parameters necessary and to
pass the class as the one and only argument.
Any ideas?
Best Regards
Clemens
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
- 14
- [POLL] Dropping support for old SpiderMonkeysHi,
as JavaScript.pm development is moving again I'm considering dropping
support for older SpideyMonkey and focusing on 1.7 and later (the one
used in FF 2.0).
Instead on having to download and install SM manually I was planning
on putting up a source release of the SM 1.7 engine on my server and
add the possibility for Makefile.PL to download and install it.
Alternatively I can bundle the source with JavaScript.pm. You will
still however have the possibility to build against your own SM src.
This way we can better control availability of utf8, threading and
e4x (and future stuff too).
Does this sound like a good idea?
Thanks
/Claes
- 15
- Java Chat Recording.Hi,
A website I use has a chat room and it's chatter-side interface is a Java
application. The comments chatters post come thick and fast and, although
there is a scoll bar, it's no good scrolling down to see comments missed,
as, as soon as a new comment is posted, all the comments scroll up to it.
There is no cut-and-paste/recording facility. As it's possible to scroll
up and down the comments, there must be somewhere where the comments are
held. Would this be just in some sort of video buffer, a
constantly-appended file on my PC's disk drive or just in memory? Is there
any way to record the conversations? Have the output from the Java
application redirected to a file, etc?
Thanks in advance.
Yours,
Gary Hayward.
|
|
|