Miguel Roque

Ranch Hand
+ Follow
since Oct 24, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Miguel Roque

Hi.

I need to export some data from a DB to a XML file but I've never worked with XML in Java so I need your help. First of all, what is the best thecnology to use? I've seen JAXB, SAX, DOM and some others, but I don't know where to start here and what will be the best one to use.

In order to create the XML, I must follow the rules from a xsd file and the created XML will have several sections created, each of the sections being retrieved from a different table/tables.

Thanks,
Mike

Originally posted by William Brogden:

If you want any extra formatting line feeds you will have to write them to the output stream yourself. The XML specification does not require line breaks or other human readable formatting.

Bill



Is there any other package and class that I can use and that will allow the auto formatting of the output?

Thanks
Hi.

Yes, the user click a HTML link and receives the file. The application will work on a Intranet mainly, but it can also work over the Internet, but on those cases, the file will be a smaller one for sure. Also this 150Mb will be maybe a 1% case as the rest of them will be around 10 to 20Mb and with today connections this is like 5m download or even less.

Concerning the formating, I need it to read the file when making the development as I must check if nothing is missing and if everything is in place cause rigth now I don't have any data to put on the file and I'm only preparing the structure of it, so that when I receive the missing data, everything is in place and it's a 5 minute change on the code to add it.

I have a "xsd" file. How can I validate my XML file on the fly with the XMLStreamWriter?

Thanks
Hi.

First and in response to James Clark, the file has to be large as it must contain the accounts information from a entire year. With all the needed information, it can be a huge file.

Now, regarding the creation of this file, I've decided to use a XMLStreamWriter, but I'm having here some problems. The main one is that the created file doesn't have the new line at the end and the xml file created is not formatted!

How can I make XMLStreamWriter to add a new line at the end of a element and make it format the output?

Thanks
Hi.

I need to create a XML file on a servlet and then send it to the user. As this XML file can be very big (150Mb in some cases), what will be the best package to create it? Can javax.xml.stream handle it?

Thanks
Hi.

I'm making a servlet that will process some information from the database and then must return a XML file to the user. How can I automaticaly send the result XML file to the client in the servlet, meaning, how can the browser present a message where the user is asked where to save the file?

A second question, not directly related to servlets, what is the best package to create the XML file? I'm testing with javax.xml.stream but I'm affraid that this could not handle the XML file that can be up to 140Mb or even more!

Thanks
15 years ago
Hello.

The reason is simple. If you read the Java Language Specification you will find that, and I quote:


The null type has one value, the null reference, represented by the literal null, which is formed from ASCII characters. A null literal is always of the null type.


NullLiteral:
null



That's why it's treated as a String and not as a Object.

Miguel
Hello Rick.

I've done it by launching the scripts but it gives me a problem that is, how to capture the output so that I can know when the server as started and if it as started without problems.

Thanks,
Miguel
18 years ago
Hi.

A couple of months ago a friend have asked for my help in a similar situation. The renameTo was not working and the problem was on the file path as he was trying to rename with only the file name. Try to include the complete path for the file, for example,



Miguel
18 years ago
Hi.

I've emulated the start and shutdown sctipts and that's why I'm facing this problems. I don't want to have JBoss as a service, as I don't need it to be constantly running and I want to be able to start and stop it as needed and without having the DOS windows on it.

Miguel
18 years ago
Hello.

I'm trying to programatically start and stop JBoss server, but I'm having some problems. Actualy, my code to start/stop is as follows:



In the classpath I have added the run.jar and shutdown.jar from the bin directory of JBoss. Now the problem comes when I start JBoss where I receive the following exceptions:



If I remove the shutdown.jar from the classpath, I can start JBoss without problems, but then, I don't have any option to stop it.

Any other way to start/stop JBoss programatically.

Thanks,
Miguel
18 years ago
Hello.

Try using the IP address instead of localhost. Sometimes localhost is not well defined and that's why it gives this problem.

In my case I use http://192.168.0.1:8080/jmx-console

Miguel
18 years ago
Hello.

As anyone have had any idea on this?

Thanks,
Miguel
18 years ago
Hello.

I've checked the configuration of the classpath variable and the problem is as follows. If I put the "shutdown.jar" in the classpath, when I start JBoss I get the exceptions mentioned in the previous post. If I remove the "shutdown.jar" from the classpath variable, JBoss starts without problems, but then I'm unable to stop it!!!

Any sugestion?

Thanks,
Miguel
18 years ago
Hi again.

Yes, it's something in the classpath. If I have the classpath as follows:



It gives the exception, but if the classpath is set as:



It works!

I must see the Eclipse configuration on this, but I've added as external jar the run.jar and shutdown.jar to my project.

Thanks,
Miguel
[ June 16, 2005: Message edited by: Miguel Roque ]
18 years ago