| Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine) |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- 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
- 1
- 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>
- 2
- [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
- 8
- 9
- 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?
- 9
- 10
- 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
- 11
- Casting Object[]Hi :o)
I've created a useful routine that "appends" an Object on to the end of an
array of Object, creating a new array with slack space if there is not
enough space available (sort of like a light-weight Vector):
public static final Object[] append(Object[] buf, int buf_len, Object addxn,
int slack)
{
Object[] ptr = buf;
if (buf == null || (buf_len + 1) > buf.length)
{
ptr = new Object[buf_len + 1 + slack];
if (buf != null) System.arraycopy(buf, 0, ptr, 0, buf_len);
}
ptr[buf_len] = addxn;
return ptr;
}
Anyway, this works fine, no probs, etc.
I am having problems, however, casting Object[] onto String[] or any other
such cast. Even if, obviously, all the elements of the array are String.
Now, I can state straight off where the problem lies. If I choose a large
enough String[] buffer so that the appended String fits inside it, then the
returned array can be cast back onto String[] - however, if the buffer is
exceeded, and line 6 is executed (creating a new buffer) then it can no
longer be cast back onto String[].
Does that make sense?
Anyway, the question! Is there any way of creating an Object[] array
generically which is of the same type as the original array. In other words,
it would create a new String[] array or Color[] or Rectangle[] or whatever
as appropriate?
Is there a way of doing it by reflection??? (perhaps)
Cheers :o)
And if you don't understand what I going on about, just shout! (hehe) and
I'll try and explain better!
Will
- 12
- 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
- Junit tests, setting up tests without having to create a billion methodsJames McGill wrote:
> On Wed, 2006-02-15 at 19:42 +0000, Andrew McDonagh wrote:
>
>>email***@***.com wrote:
>>
>>>Is there a more dynamic way of setting up tests? We have legacy test
>>>code that we are trying to convert to junit.
>
>
> I really enjoyed using Fitnesse. A whole different idiom for testing,
> but very flexible and accessible to nonprogrammers.
>
> http://fitnesse.org/
>
>
> Anyway, it sounds like you're working backwards. You've already written
> the code you want to test, which is backwards from TDD, which sort of
> means JUnit isn't exactly the right tool for what you're doing. Still
> it occurs to me that you should be able to automatically generated
> wrappers for your legacy tests, and put those into a testsuite, and be
> done with the legacy stuff and move forward with JUnit.
>
>
>
Hi James,
You seem have have attributed the OPs remarks to me...
That being said, the OP is specifically talking about the case where we
have a legacy code base which wasn't tested with Junit - not that it
wasn't tested. There's no mention of whether TDD was used or not -
though I think we both suspect it wasn't and that the code base was
merely Unit Tested.
Unfortunately, working with legacy code is currently the most common
starting point on projects that adopt TDD. Greenfield projects using TDD
are still rare.
Also, keep in mind, whilst JUnit was developed as a tool to Aid TDD,
Beck et al do realise that some people won't or can't do TDD but still
need a decent Unit Testing tool.
As I'm sure you know - but as an aid for others - TDD is not Unit Testing.
TDD is actually a design methodology that happens to use unit tests to
describe the design. Much like RUP uses UML, etc. In fact this usage of
the term Test has causes so many to concentrate on the testing side of
TDD that some are now starting to question whether a better name could
be found.
e.g.
Behavior Driven Development (http://behaviour-driven.org/)
Specification Driven Development
etc.
Andrew
- 13
- Run Excel Macro from JavaI want to run the macro present inside the excel sheet using the Java
code. Is is possible using Java code? Please help
- 13
- 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
- 13
- Simple While Loop problemJohn wrote:
> ththx.
>
> the code is wrong. months will be determined by the loan amount not just an
> arbitary number
>
>
> cheers
>
>
Can you not top-post please, John? It makes threads very hard to follow...
alex
- 13
- 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.
- 15
- 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
|
| Author |
Message |
kalim1999

|
Posted: 2003-8-22 13:20:00 |
Top |
java-programmer, Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine)
"codewriter" <email***@***.com> wrote in message news:<Swd1b.4631$email***@***.com>...
> Java days are numbered. Dot Net is going to take over. This is the reality.
> So, you guys better get some C# books before it is too late.
> Amen.
ROTFLOL!
how many times did i hear this from j++ guys awhiles back, and even
from some ASP and COM jocks in AT&T (where i worked) in 1997(?) or so.
guess what happened? i'm still laughing my way to the bank and they're
trying to figure out c#/vb.net - the old microsoft treadmill,
methinks....
http://www.angrycoder.com/article.aspx?cid=1&y=2003&m=7&d=17
believe me, java will still be here years from now when microsoft has
moved on to the next BIG THING (dragging along all the developer
baggage for the ride - most of whom will be c#/vb.net developers in
india, no doubt).
in the meantime, some interesting news:
it seems sun may not be so stupid after all, and is working very
closely with open source organizations like apache and red hat to
spread java.
after apache announced a few weeks ago that it would be creating its
own open source J2EE app server, red hat announced that it was
planning on an open source java, with sun's blessing.
http://www.freeroller.net/page/kalimantan/20030822#red_hat_and_sun_to
methinks microsoft is in very big trouble.
|
| |
|
| |
 |
The Ghost In The Machine

|
Posted: 2003-8-23 4:00:00 |
Top |
java-programmer >> Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine)
In comp.lang.java.advocacy, asj
<email***@***.com>
wrote
on 21 Aug 2003 22:19:55 -0700
<email***@***.com>:
> "codewriter" <email***@***.com> wrote in message news:<Swd1b.4631$email***@***.com>...
>> Java days are numbered. Dot Net is going to take over. This is the reality.
>> So, you guys better get some C# books before it is too late.
>> Amen.
>
> ROTFLOL!
>
> how many times did i hear this from j++ guys awhiles back, and even
> from some ASP and COM jocks in AT&T (where i worked) in 1997(?) or so.
J++?
Wait...wasn't that Microsoft's entry into Java which was almost
100% java, except for some unauthorized modifications designed
to "improve" Microsoft's JVM and some omissions such as RMI?
My head hurts.
> guess what happened? i'm still laughing my way to the bank and they're
> trying to figure out c#/vb.net - the old microsoft treadmill,
> methinks....
>
> http://www.angrycoder.com/article.aspx?cid=1&y=2003&m=7&d=17
>
> believe me, java will still be here years from now when microsoft has
> moved on to the next BIG THING (dragging along all the developer
> baggage for the ride - most of whom will be c#/vb.net developers in
> india, no doubt).
I suspect Java will ultimately mutate into something Smalltalk-like,
or maybe something that supports both Aspect-Oriented and
Contract-Based programming models. But I agree; it'll be here
in some form.
>
> in the meantime, some interesting news:
>
> it seems sun may not be so stupid after all, and is working very
> closely with open source organizations like apache and red hat to
> spread java.
>
> after apache announced a few weeks ago that it would be creating its
> own open source J2EE app server, red hat announced that it was
> planning on an open source java, with sun's blessing.
>
> http://www.freeroller.net/page/kalimantan/20030822#red_hat_and_sun_to
>
> methinks microsoft is in very big trouble.
Not sure what'll happen but it's good to see open source making
a run at it. Microsoft, for its part, is a very cash-rich company
so I for one don't expect it to roll over and die immediately.
I'll admit to some reservations regarding the name
"Mad Hatter". But I suppose the logical alternatives --
"SunHat" and "Red Sun" -- might have been worse. :-)
--
#191, email***@***.com
It's still legal to go .sigless.
|
| |
|
| |
 |
Tor Iver Wilhelmsen

|
Posted: 2003-8-23 6:08:00 |
Top |
java-programmer >> Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine)
The Ghost In The Machine <email***@***.com> writes:
> Wait...wasn't that Microsoft's entry into Java which was almost
> 100% java, except for some unauthorized modifications designed
> to "improve" Microsoft's JVM and some omissions such as RMI?
Yes. It has resurfaced, if you will, in the form of J# - you can even
get an experimental JFC/Swing implementation for it. Support for it is
an optional install, though, but so is the support for most other
languages than the four Microsoft support in VS.Net.
> I suspect Java will ultimately mutate into something Smalltalk-like,
Why, we already have Objective-C for that. <g>
> or maybe something that supports both Aspect-Oriented and
> Contract-Based programming models.
Eiffel?
A point to remember is that Java "beat" both of them.
|
| |
|
| |
 |
Tor Iver Wilhelmsen

|
Posted: 2003-8-23 17:03:00 |
Top |
java-programmer >> Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine)
"Chad Myers" <email***@***.com> writes:
> That's a stretch. J# is not an attempt to be compatible with Java,
> far from it. The point is to assist the legions and legions of
> Java developers tripping over themselves to get .NET ;).
No, it's support for J++ apps in .Net, hence it succeeds J++.
> J++ was an attempt to embrace and extend Java, J# is just an example
> of how flexible .NET can be.
J# is a continuation of J++ in the .Net environment.
http://msdn.microsoft.com/vjsharp/productinfo/overview/default.aspx
"Visual J# .NET 2003 includes tools to automatically upgrade and
convert existing Visual J++ 6.0 projects and solutions to the new
Visual Studio .NET 2003 format. These tools ensure that an existing
Visual J++ 6.0 developer can move easily to Visual J# .NET 2003 and
produce .NET-connected applications and components."
Though they also have the Java-to-C# route:
http://msdn.microsoft.com/vstudio/downloads/tools/jlca/
> But you can have them all (well, maybe not ObjC) in .NET :)
What would be the point? Companies will kill themselves if they let
developers pick their own languages - code will at some point be
handed over to someone else, and someone would go crazy if they have
to support an application written in fifty different languages (which
are as many as someone from Microsoft claimed existed for .Net).
> There is a full Eiffel impl for .NET (yes, including MI, which is
> some wizardry that frightens and confuses a simple caveman like
> myself)
It probably uses delegation to "fake" MI.
|
| |
|
| |
 |
Chad Myers

|
Posted: 2003-8-24 4:01:00 |
Top |
java-programmer >> Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine)
"Tor Iver Wilhelmsen" <email***@***.com> wrote in
message news:email***@***.com...
> "Chad Myers" <email***@***.com> writes:
>
> > That's a stretch. J# is not an attempt to be compatible with Java,
> > far from it. The point is to assist the legions and legions of
> > Java developers tripping over themselves to get .NET ;).
>
> No, it's support for J++ apps in .Net, hence it succeeds J++.
Hrm.. not really. It's designed to be language-compatible for
the most part with Java, but MS doesn't make any claims that it
is compatible with, or can be cross-framework portable. The
only point is to make Java developers feel at home so they'll
convert. This means both J++ and Sun Java developers.
There are converters (Microsoft Java Language Conversion Assistant,
etc) that ease this process.
J++'s point was to try to be binary compatible with Java (unless
you used the switch that allowed JDirect code), J# has no such
point.
> > J++ was an attempt to embrace and extend Java, J# is just an example
> > of how flexible .NET can be.
>
> J# is a continuation of J++ in the .Net environment.
>
> http://msdn.microsoft.com/vjsharp/productinfo/overview/default.aspx
>
> "Visual J# .NET 2003 includes tools to automatically upgrade and
> convert existing Visual J++ 6.0 projects and solutions to the new
> Visual Studio .NET 2003 format. These tools ensure that an existing
> Visual J++ 6.0 developer can move easily to Visual J# .NET 2003 and
> produce .NET-connected applications and components."
Right, like I said, J# is fully .NET. It's not J++ 7.0. They are
saying that J++ and Java users should convert to .NET -- and oh, by
the way, we have this nifty language called J# that'll make it
easy for you.
> Though they also have the Java-to-C# route:
>
> http://msdn.microsoft.com/vstudio/downloads/tools/jlca/
>
> > But you can have them all (well, maybe not ObjC) in .NET :)
>
> What would be the point? Companies will kill themselves if they let
> developers pick their own languages - code will at some point be
> handed over to someone else, and someone would go crazy if they have
> to support an application written in fifty different languages (which
> are as many as someone from Microsoft claimed existed for .Net).
The point is not to let every developer choose his or her own
language on the same project, the point is to let different
companies choose their language of choice, without loosing
compatibility with other departments in the same company or
partners with the company.
If you had a large company that had some Java here, some C++
here, some VB6 here and some COBOL over there, you could start
making a standard that all new projects must be .NET. The various
departments would have very little to do to meet that requirement.
Compared with having each department write all these crazy
interop DLLs and frameworks so that the VB6 can talk with Java
can talk with COBOL and use CORBA, etc, .NET makes a hell of a
lot more sense.
> > There is a full Eiffel impl for .NET (yes, including MI, which is
> > some wizardry that frightens and confuses a simple caveman like
> > myself)
>
> It probably uses delegation to "fake" MI.
No, the original Eiffel impl used tricks like that, but the new
version does not. It's an interesting read. There are
several articles about it, here's the first one that
popped up on my Google search:
http://tinyurl.com/kytc [MSDN]
Here's the Google search, there are lots of other good
articles:
http://tinyurl.com/kyth [MSDN]
-c
|
| |
|
| |
 |
kalim1999

|
Posted: 2003-8-24 6:21:00 |
Top |
java-programmer >> Open source Java on the way! (Re: BEA Weblogic blows away .NET, other J2EE servers in review by PC magazine)
"Chad Myers" <email***@***.com> wrote in message news:<email***@***.com>...
<SNIP>
J# is a useless microsoft marketing invention, just like J++ was a
thwarted attempt by microsoft to hijack java. i'm still laughing at
all the j++ idiots who ignored all our warnings. they used to have a
J++ newsgroup too - LOL.
Visual J# .NET - A Solution Looking For A Problem?
http://www.angrycoder.com/article.aspx?cid=10&y=2002&m=7&d=10
Too close to C#
Any Java developer who is worth his salt has probably recognized the
phenominal (and intentional) similarity between Java and C# syntax. If
a Java developer were inclined to switch to .NET development, why
would they not use the language that Microsoft is likely more
concerned about? A typical Java developer is more skilled than 9 out
of 10 VB programmers out there (a sad, but undeniable truth), so
picking up the syntactic differences between the two languages
wouldn't be very difficult to do. The biggest challenge is learning
the classes in the .NET Framework, anyway.
Java developers don't want to convert, anyway
If I was a good Java developer (which I'm not...I've only dabbled in
it), why in the hell would I want to switch to .NET? I would already
have just about everything that .NET has to offer (the .NET
feature-set was largely based on the design of the Java architecture),
and I would get cross-platform compatibility to boot. The .NET
Framework and languages are cross-platform capable, but it's still a
long way from being a reality (yeah, I know about the various ongoing
cross-platform .NET projects). It would seem like a major leap, just
to get back to a fraction of where I am today, considering you can
find Java in everything from the microchip in your credit card to
embedded systems to PDA operating systems to PCs to supercomputers.
That's a lot of market coverage to give up. Java developers don't
really want .NET, so it's kind of a tough sell.
Visual J# is likely just a marketing ploy
It is unrealistic to think that Microsoft will continue to support two
ultra-similar .NET languages on a long-term basis. When it comes time
to choose, Microsoft will most likely throw its weight behind the
language that they hatched themselves, unfettered by any alphanumeric
attachment to SUN. Visual J# is a bridge technology, created to woo
Java developers (unsuccessfully, I'll wager). Who wants to invest a
lot of money and effort into developing with a bridge technology?
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- JVM sourcesHi,
Where can I find C sources for JVM 1.4 for Windows ?
Thanks
Xavier
- 2
- Axis e Web ServiceSalve,
sto realizzando un applicazione Java che utilizza un Web Service con
Eclipse 3.2.
Questo Web Service ha il compito di salvare un oggetto su database
MySQL facendo uso delle librerie di Hibernate 3.1.3.
L'applicazione gira su un server Tomcat 5.5 che fa uso delle librerie
j2sdk1.4.2_10 e utilizza librerie di Axis 1.4 per i Web Service.
L'applicazione ?in realt?costituita da un applicazione client che
richiama il Web Service ed un applicazione server che si preoccupa di
salvare gli oggetti sul database. Eseguendo il client ottengo il
seguente errore:
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:notebook-pc
java.lang.reflect.InvocationTargetException
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at source.Start.main(Start.java:42)
In particolare ho notato che questo si verifica nel momento in cui si
invoca un metodo chiamato "save" messo a disposizione da Hibernate. Se
commetto la riga corrispondente a tale istruzione, richiedendo al web
service di restituire semplicemente una stringa, l'applicazione
funziona correttamente. Suppongo che il problema derivi dal database
MySQL, ma non capisco di cosa si tratta. Avete qualche idea?
- 3
- Python and cellular automata (It works this time!)I thought people would be interested in this little script I wrote to
reproduce the 256 simple automata that is shown in the first chapters
of "A New Kind of Science". You can see a few results without running
the script, at http://cooper-j.blogspot.com . And here is the code (You
will need PIL (Python Imaging Library)):
<code>
import Image
# Contract:
# To simulate simple cellular automata.
class calculations:
def __init__(self,which):
self.against = self.array_maker_2()[which]
self.check = self.array_maker_1()
self.array = self.array_maker_3(311)
self.calculator()
def binary(self, n, size): ## This is the Int -> str(BINARY)
converter
assert n >= 0
bits = []
while n:
bits.append('01'[n&1])
n >>= 1
bits.reverse()
result = ''.join(bits) or '0'
for iteration in range(len(result),size):
result = "0" + result
return result
def array_maker_1(self): # This makes the array that represents the
8 different permutations of 3 cells. Itself, its left and its right.
return [self.binary(n, 3) for n in range(8)]
def array_maker_2(self): # This makes the array that represents
every single different rule. If for instance the second element in one
# of these rules is 1, then the corresponding permutation that may
be found in the result array (array_maker_3), will be 1 (black).
return [self.binary(n, 8) for n in range(256)]
def array_maker_3(self, y): # This is the array for all the
results. The automaton starts from the middle of the first row
x = [["0" for x in range((2*y)+1)] for n in range(y)]
x[0][(2*y+1)/2] = "1"
return x
def calculator(self): # This cycles over all of the cells, and
scans one row at a time, and changes the next row according to the
current cell.
self.buff_result = ["0","0","0"] # This is the current permutation
buffer to be checked against the corresponding arrays.
for i in range(len(self.array)-1):
for j in range(1, len(self.array[0])-1):
self.step1(j,i)
self.step2(j,i)
self.step3(j,i)
y = self.check.index(''.join(self.buff_result))
self.array[i+1][j] = self.against[y]
# The steps update the result buffer.
def step1(self, step, y):
self.buff_result[0] = self.array[y][step-1]
def step2(self, step, y):
self.buff_result[1] = self.array[y][step]
def step3(self, step, y):
self.buff_result[2] = self.array[y][step+1]
for number in range(256):
objo = calculations(number)
x = objo.array
y = []
for num,zo in enumerate(x):
for com,wo in enumerate(zo):
x[num][com] = int(wo)
nim = Image.new("1", (623,311))
for n in x: #converting the array of arrays into a single array so
putdata can take it.
for p in n:
y.append(p)
nim.putdata(y)
nim.resize((6230/2,3110/2)).save("output" + str(number) + ".png")
print number
</code>
- 4
- RSA encrypt session keyDoes anyone know how to encrypt a secret key with a public key algorithm
to transmit it to another computer securely. Have tried using RSA and
have had no look in the following code:
public byte[] encryptSessionKey(SecretKey sKey, PrivateKey pKey, String
algorithm)
{
System.out.println("linex");
Cipher cipher = Cipher.getInstance(algorithm+"/ECB/PKCS#1");
System.out.println("liney");
cipher.init(Cipher.WRAP_MODE, pKey);
System.out.println("linez");
return cipher.wrap(sKey);
}
It prints out liney but not linez which suggests the Cipher object can
not encrypt a session key in wrap mode.
Thanks.
- 5
- Faster JPEG Decoder?On 19 Aug 2005 16:14:17 -0700, email***@***.com wrote or quoted :
>Currently we use JPEGImageDecoder which is the fastest of the three but
>still it takes up a lot of CPU time.
>
>Any suggestion? Thanks in advanced.
The obvious thing to consider is to predigest your images into some
other format that does not require so much processing to fluff it up.
They will probably be bigger.
When you create the jpg images you can control the
compression/quality. Presumably lower quality images will display
faster.
If you are displaying them or scrolling over them, then you might look
into what speedups are possible with VolatileImage.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
- 6
- Licence code storing for java appHello,
I want to create a app which will have something similar to licence
(i.e. user have to enter licence code to run the app). The problem
arises when I want to make it that user have to specify it only once.
So I need to store somewhere the information, that the app has already
been activated. I am thinking about main jar file (as something which
can work ,although it is nothing sophisticated), but when I add extra
characters at the end then my jar was corrupted :(. Do you know any
nice way to do this:)? Thank you!
Regards, mark
- 7
- TRYING TO CREATE A SIMPLE FORM. HELP HELP HELP!!!!trying to make a simple form, just an empty window with no button.
ive tried this
import javax.swing.*;
import java.awt.*;
import java.util.List;
import java.util.*;
public class Canvas
{
private static Canvas canvasSingleton;
public static Canvas getCanvas()
{
if(canvasSingleton == null) {
canvasSingleton = new Canvas("BlueJ Shapes Demo", 300, 300,
Color.white);
}
canvasSingleton.setVisible(true);
return canvasSingleton;
}
}
but it doesnt work :( any ideas guys?
- 8
- looking for some hands on experience... i have bought and read LEARNING JAVA by niemeyer
i loved it but find i need some hands on experience.
any help?
kevin
--
Sometimes I'm in a good mood.
Sometimes I'm in a bad mood.
When all my moods have cum to pass
i hope they bury me upside down
so the world can kiss me porcelain,
white, Irish bottom.
- 9
- eclipse, integrating crystal reports plugin with rcp appHello,
I have got a problem, I have to integrate Crystal Reports plugin with
my RCP app. I want Crystal Reports perspective aviable in my
application.
I've downloaded crystal reports plugin, and unpacked it to my_rcp_app
\plugins,
and I've run eclipse with -clear flag. but crystal reports plugin
isn't visible in Plug-In details window.
How can I cope with that problem ?
Is the any tutorial, or sth. about integrating plugins with RCP app ?
thanks a lot for any help
- 10
- jigsaw's jdbmI like that I can use the jigsaw outside if jdbm. For
writing j2me (personal java) that don't have any sort
of record manager on the device I want to also use
jdbm there. However jdbm requires some of the file
classes that are not universally available within
j2me. I don't have the error posting just now (stupid
me) from javac to show what's missing. Has anyone
worked through this or have another idea for an
embedded data (flatfile) manager for j2me?
Mike
- 11
- Returning a reference to an objectHi,
I've created a class to implement a state machine, so it's got a State
attribute. It has algo got a private java.util.Stack attribute.
In order to work, State classes need to access the stack to push and pop
data, etc.
To access it from State, I have wrote a method called getStack() which
returns a reference to the stack, but I think this is not recommended
beacause all objects sharing the reference can modify it, and led to errors
difficult to debug, etc. Returning a stack's clone is not valid solution,
as I have to make changes on the real one.
So my question is, is there a cleaner way to do this?
Thank you very much
--
PGR
- 12
- Getting ready for 1.5I'd like to prepare for JDK 1.5. I know that generics/templates
will be in there. Will standard Java classes be retofitted to
use this new feature as appropriate? I'm thinking of course
about the collections, but also wondering about stuff such as
the clone interface.
I also know that enums will be in there. (Because the bug status
changed to closed/fixed.) But in what form? There were at least
two JSRs for that last time I checked.
Thanks!
-Wayne
- 13
- Java application help?????????????How do you create a pause in a Java application that requires you to
press a key to continue until the conditional statement is complete?
The folowing is what I have so far..
class Count{
public static void main(String[] arguments) throws Exception {
int a = 100;
int b = 20;
int x;
for (x = 0;x < a;x++) {
System.out.println((x+1) + "." + "Message goes here to be displayed
100 times.");
}
I would like the application to display 1 - 20 then pause and display
20 more and 20 more and so on. I tried to use System.in.read();, but
it only displayed two at a time. Please Help.
- 14
- Read the index of item with X value.On Mar 26, 10:42 pm, "Mariano" <email***@***.com> wrote:
> I've a ComboBox ..
>From where? There is no ComboBox in the JSE.
Are you perhaps referring to java.awt.Choice,
or javax.swing.JComboBox?
..
> How could I resolve?
1) Be specific about the classes used, rather
than simply 'making the names up, as you go along'
2) ..
Andrew T.
- 15
- Hibernate, connection pool and firewall questionAn odd combination of topics, to be sure.
My current web application (Tomcat hosted) has a custom-rolled
connection pool. The Informix DB I connect to is across a firewall
that terminates existing connections after 120 minutes, regardless of
their current activity. My pool handles this by detecting the
creation date of a connection it wants to reuse. If that connection
was created > 60 minutes ago it closes the connection and fetches a
replacement to use in the pool.
Simply using a connection until the 120 minute barrier is reached
isn't acceptable because the DB isn't smart enough to realize that the
firewall has stopped the connection's use. The explicit release after
60+ minutes releases the connection and keeps the simultaneous
connection use down (we are licensed by the number of simultaneous
connections).
When I look at Hibernate and its connection pools (DBCP and C3P0,
there might be others) I'd like to use their stuff instead of my
home-grown pool. But I don't really see a parameter like "only use
this connection for 60 minutes" or such. Can I find such a parameter
in one of the pool possibilities?
TIA,
Jerome.
|
|
|