dear all,
i want to read a mp3 file using java and want to download it in jsp,i want to return byte array or i can only return one byte at a time?.please suggest
Hi all,
I have been using JBoss Seam now for over a year and still haven't seen much acceptance here in the US. My metrics are, the number of jobs that indicate JBoss Seam and number of people talking about JBoss Seam (Java groups / JBoss Seam groups, etc.).
Is JBoss Seam more popular outside the US?
Walter
hello all.
I have an array:
int test[]={10212,10202,11000,11000,11010};
I want to split the inetger values to individual digits and place them in a new array as individual elements such that my array now is:
int test2[]={1,0,2,1,2,1,0,2,0,2,1,1,0,0,0,1,1,0,0,0,1,1,0,1,0};
How would i go about doing that? I'm doing this in java.
Thank you.
Recently I started to use Eclipse's java compiler, because it is significantly faster than standard javac. I was told that it's faster because it performs incremental compiling. But I'm still a bit unsure about this since I can't find any authoritative documentation about both - eclispse's and sun's - compilers "incremental feature". Is it true that Sun's compiler always compiles every source file and Eclipse's compiler compile only changed files and those that are affected by such a change?
hello
how could we uses junir related methods?
could we launch setuponce from each java test?
if in my test I launch the appli by calling setuponce, is it correct ?
hi,
I'm trying to access owl file using jsp.I've successfully load the owl file and quering that using SPARQL.But still I couldn't success with JSP.
I'm always getting error "java.lang.ClassNotFoundException: com.hp.hpl.jena.util.FileManager
"
help me!
Thank in advance!
I´m developing a Java solution for manage an iTunes Library (ITL file). The ITL format is a propietary one.
I'm looking for an implementation or a documentation about ITL format but Google can't find anything useful.
Does anyone have experience about that? Where to find more information?
Thanks in advance.
Hi,
there is a poker-system in java, that uses Collections.shuffle() on all available cards before the cards are dealt.
So a collection of 52 cards 2-9, J, Q, K, A in 4 types.
After that we Collections.shuffle().
The problem is, that it seems (until now we didn't have big statistic, it's possible that we only see a lot of statistic inferences), that the algorithm is VERY unclearly.
So, is Collections.shuffle() okay for a poker algorithm?
I'm creating a JAX-WS type webservice, with operations that return an object WebServiceReply. The class WebServiceReply itself contains a field of type Object. The individual operations would populate that field with a few different data-types, depending on the operation.
Publishing the WSDL (I'm using Netbeans 6.7), and getting a ASP.NET application to retrieve and parse the WSDL was fine, but when I tried to call an operation, I would receive the following exception:
javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: class [LDataObject.Patient; nor any of its super class is known to this context.]
How do I mark the annotations in the DataObject.Patient class, as well as the WebServiceReply class to get it to work? I haven't been able to fine a definitive resource on marshalling based upon annotations within the target classes either, so it would be great if anybody could point me to that too.
WebServiceReply.java
@XmlRootElement(name="WebServiceReply")
public class WebServiceReply {
private Object returnedObject;
private String returnedType;
private String message;
private String errorMessage;
.......... // Getters and setters follow
}
DataObject.Patient.java
@XmlRootElement(name="Patient")
public class Patient {
private int uid;
private Date versionDateTime;
private String name;
private String identityNumber;
private List<Address> addressList;
private List<ContactNumber> contactNumberList;
private List<Appointment> appointmentList;
private List<Case> caseList;
}
Solution
(Thanks to Gregory Mostizky for his answer)
I edited the WebServiceReply class so that all the possible return objects extend from a new class ReturnValueBase, and added the annotations using @XmlSeeAlso to ReturnValueBase. JAXB worked properly after that!
Nonetheless, I'm still learning about JAXB marshalling in JAX-WS, so it would be great if anyone can still post any tutorial on this.
Gregory: you might want to add-on to your answer that the return objects need to sub-class from ReturnValueBase. Thanks a lot for your help! I had been going bonkers over this problem for so long!
This is my problem, I have to use a big SP, and there is no time to rewrite in java.
So I'm using Hibernate criteria and I don't know if i can call it. Thanks to all.
I'm trying to save a file to a Sharepoint server using JAX-WS. The web service call is reporting a success, but the file doesn't show up.
I used this command (from a WinXP) to generate the Java code to make the JAX-WS call:
wsimport -keep -extension -Xnocompile http://hostname/sites/teamname/_vti_bin/Copy.asmx?WSDL
I get a handle on the web service which I called port using the following:
CopySoap port = null;
if (userName != null && password != null) {
Copy service = new Copy();
port = service.getCopySoap();
((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userName);
((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
} else {
throw new Exception("Holy Frijolé! Null userName and/or password!");
}
I called the web service using the following:
port.copyIntoItems(sourceUrl, destUrlCollection, fields ,
"Contents of the file".getBytes(),
copyIntoItemsResult, copyResultCollection)
The sourceUrl and the only url in destUrlCollection equals "hostname/sites/teamname/Tech Docs/Sub Folder".
The FieldInformationCollection object named fields contains only one FieldInformation.
The FieldInformation object has "HelloWorld.txt" as the value for displayName, internalName and value.
The type property is set to FieldType.FILE. The id property is set to (java.util.UUID.randomUUID()).toString().
The call to copyIntoItems returns successfuly; copyIntoItemsResult contains a value of 0 and the only CopyResult object
set in copyResultCollection has an error code of "SUCCESS" with a null error message.
When I look into the "Tech Docs" library on Sharepoint, in the "Sub Folder" there's no file there.
Why wouldn't it tell me what I did wrong? Did I just miss a step?
Update (Feb 26th, 2011)
I've changed my FieldInformation object's displayName and internalName properties to be "Title" as suggested. Still no joy, but a step in the right direction.
After playing around with the urls for a bit, I got these results:
With both the sourceUrl and the only destination URL equivalent, with no protocol, I get the SUCCESS response but no actual document appears in the document library.
With both of the URLs equivalent but with an "http://" protocol specified, I get an UNKNOWN error with "Object reference not set to an instance of an object." as the message.
With the source URL an empty string or null, I get an UNKNOWN error with " Value does not fall within the expected range." as the error message.
i am writing stored procedures in MySQL that return values;
CREATE PROCEDURE getCustomerById (id int)
BEGIN
SELECT *
FROM customer
WHERE customer.id = id;
END;
and i get the error that the results cannot be shown in the given context.
after some googling, i think that i need to set the flag "CLIENT_MULTI_RESULTS" - i am connecting the database from JDBC using a java app, but cant find where to set it!
any suggestions?
Hello
Does anyone know if there's a method in Joda Time or Java itself which takes either an int or a String as an argument, e.g. 4 or "4" and gives the name of the month back in short format, i.e. JAN for January?
I suppose long month names can be truncated and converted to upper case.
Thanks
Mr Morgan.
Situation: jax-ws web service on Weblogic appserver; wsdl first development, jaxb customizations in external binding file.
I would like to get a handle to the actual jaxb context that will process the incoming soap xml message, before it has been unmarshalled into java objects.
Then I would like to get the unmarshaller of this jaxb context - the one that actually will be used during the unmarshalling. And then setup some properties of this unmarshaller (e.g. listener and idresolver).
I am currently using Selenium 2.0a2 in Java to access the Internet using an HtmlUnitDriver instance. The problem I am facing is that, when I attempt to access slow websites, the request times out. How can I increase the time that WebDriver waits before throwing a timeout exception?
Hi!
Is it possible to set 'clipping bounds' in JOGL? Like in Java/Swing i would like to set clipping bounds and all drawing/rendering outside those bounds would be ignored.
i'm using enums to replace String constants in my java app (jre 1.5).
is there a performance hit when i treat the enum as a static array of names, in a method that is called constatnly (e.g. when rendering the UI)?
my code looks a bit like this:
public String getValue(int col) {
return ColumnValues.values()[col].toString();
}
thanks, asaf :-)
An Android Java project placed in a git repository and built in an Android tree in /packages/apps needs to have the project files located at the root of the git repository.
This is problematic for creating a complementary Test project, which should ideally be included in the same git repository so commits are atomic for both code and tests. Eclipse gets very unhappy if you include the Test project as a subdirectory.
Is there an appropriate approach for dealing with this other than creating a second repository?
I have a class Client.java in two different jars jar1 & jar2
Now at run time i want to decide which Client.class loaded like
if (country==india){
// load Client class of jar1
) else{
load client class from jar2
}
can i do that...
Has anyone been able to get Oracle Forms running JInitator to loan in Internet Explorer 8 yet? I have tried removing all add-ons, various version of Java, add the domain to the trusted sites using wildcards, and using compatibility mode to no avail. I am looking to get our Oracle guys to kick there Internet Explorer 6 habit. This is related to Oracle E-Business.
I am using an Compiler called Polyglot which is a highly extendable compiler for Java.
I seem to have run into this Exception while trying to compile some test code:
"Invalid action number found in internal parse table."
How can I make a valid action number for the parse table?
Hi,
Is it possible to calculate the bounds of a htmlized String in Java Swing?
I tried using the BasicHtml.createHTMLView, but kept getting the same prefSpan; irrespective of the component font.
Regards,
Pavan
Hi,
I want to download you tube videos programatically (using Java). How can i convert you tube video link to a downloadable URL.
Browser plays youtube videos with following code.
I tried downloading from URL http://www.youtube.com/v/OdAE3cWlmHw
but it is not returning video bytes.
Thanks
Lalit
In Java, I may have a class, for example, "utility" ....., and I have a static method called "changeToCapitalLetter", so , I can do something like this:
Utility.changeToCapitalLetter(String myString);
How can I do the similar thing in Objective C? thz a lot.