I'm honestly frustrated with OpenSolaris right now. I love the operating system. I've been running it on my laptop since I bought it a year and a half ago. Windows ran on it for less than a day, and then I wiped it and loaded OpenSolaris on it.
It was a choice between OpenSolaris, FreeBSD, and Ubuntu. I had been reading a lot about OpenSolaris, and it sounded interesting. I decided on OpenSolaris because I was, and still am, doing Java programming. It's what I bought the laptop for.
I've been frustrated since I loaded it that the wireless network card doesn't work, the built in camera doesn't work, and the audio drive is really terrible (if I change the volume, I lose the left channel). I just recently got mp3's to work, and still have to use mplayer for other media. I've never been able to run the latest version of Gnucash on it (I run it in vbox on a Ubuntu image). Now, I've not been able to update the os for a couple of months now because of a kernal panic (or some such) when booting. I was waiting on the latest update, because it was apparently fixed, at least on other systems. I posted a message on the help forum, but I need to put the kernel into debug mode during booting to find out why it's forcing a reboot during the boot cycle.
Ok, may be I need to move on. If the contract I'm working on does not have anything for me this weekend, I may spend the weekend moving to either Ubuntu or PC-BSD. Or may be I'll split the drive and dual-boot between the too.
The main thing that is stopping me is Windows. That's very frustrating for me. I run Windows under VirtualBox and use it because I'm currently working on a project, in Java, that has to be run under Windows (it uses a native engine for it's core function). I worry that the vbox images will not work under Ubuntu or BSD. I suppose I can recreate everything, but that could take the entire weekend by itself.
If I don't have the time, I hope the next version of OpenSolaris fixes this issue, but I still would like to get the wireless networking and other issues working. Especially since the whole family is now using it.
I won't walk away from OpenSolaris completely. It is still my intention on building a computer from the components and it will be geared towards OpenSolaris. Primarily because of ZFS, but also on how well it runs VirtualBox. I want something I can run multiple operating systems on, for different functions. But for now, I don't think it's perfect for the computer I'm currently using.
Tuesday, November 3, 2009
Friday, October 30, 2009
Where is your heart?
I've wanted to be a writer since I was a teenager. I remember my mom asking me if it was alright if my cousin read a story I was working on, because she was much younger and my mom was afraid the story my have "adult" themes in it. It didn't, so my cousin was my very first reader.
In my early twenty's, on a midnight shift in the Air Force, I decided I needed to make my name standout, for the binder of a book. I played with different spellings of Ricky, Rich, and Rick, but I no longer felt like a Ricky, which I had been growing up. Some people were calling me Rich; some Rick. I decided I liked Rick, so I played with different spellings like Ric and Rik. It didn't hurt that the horse clan books were some of my favorite at the time. So I started spelling my name Rik, primarily because I thought it would look good on a book cover.
I've heard that real authors keep something to write on close by, because they never know when a story might hit them. I just noticed that I do the same, but not for stories, but for coding problems. I had to run down stairs a moment ago to write down the pseudo-code for a design I have to turn in on Monday, because I had finally worked part of it out.
So although I've always wanted to be a writing, it's possible at this time, I am were I am supposed to be. Hopefully like Dave Duncan (a wonderful writer) I can retire to my dream of writing. But for now, I am what I am. A programmer.
In my early twenty's, on a midnight shift in the Air Force, I decided I needed to make my name standout, for the binder of a book. I played with different spellings of Ricky, Rich, and Rick, but I no longer felt like a Ricky, which I had been growing up. Some people were calling me Rich; some Rick. I decided I liked Rick, so I played with different spellings like Ric and Rik. It didn't hurt that the horse clan books were some of my favorite at the time. So I started spelling my name Rik, primarily because I thought it would look good on a book cover.
I've heard that real authors keep something to write on close by, because they never know when a story might hit them. I just noticed that I do the same, but not for stories, but for coding problems. I had to run down stairs a moment ago to write down the pseudo-code for a design I have to turn in on Monday, because I had finally worked part of it out.
So although I've always wanted to be a writing, it's possible at this time, I am were I am supposed to be. Hopefully like Dave Duncan (a wonderful writer) I can retire to my dream of writing. But for now, I am what I am. A programmer.
Friday, October 2, 2009
Keeping it separate
I've decided to move all programming posts off to their own blog (Just Thinking: Code). This allows me to post code, or thoughts on programming languages and issues without messing it up with thoughts on gluten insensitivity, theology, martial arts, or just random thoughts. Geeky thoughts that don't specifically deal with a programming solution will still be posted here.
In a similar vein, if I feel the un-suppressible need to post about politics, I will post it to Just Thinking: Politics.
In a similar vein, if I feel the un-suppressible need to post about politics, I will post it to Just Thinking: Politics.
Writing on Twitter
My last post on Twitter stated that I hadn't found my voice yet. Since then I've used it for quick updates on Fighter Practice or Aikido for those interesting in what I'm doing there; some quick thoughts that others might find helpful; and some thoughts I've found funny. If I thought it was anything that needed more explanation, I would come here to post it.
I had thought I would throw out the occasional political statement there, as I've taken a stand that it's inappropriate to make divisive political statements on Facebook, as FB seems more geared towards friends getting together for bs sessions. Most people would not throw out something just to generate an argument in such a setting.
So I threw something out on twitter that generated a lot of feedback from friends. And I realized that I was not comfortable with that. Not because of those friends, who are great and I love them dearly, but because of the crowd watching.
It's a shame that our society has gotten to a point that taken a political stand can destroy friendships, and possibly generate enough hatred as to put one in physical danger.
Friday, September 25, 2009
Griffon framework is great for quick utilities
Update, moved to Just Thinking: Code
I've been very successful this week in throwing together a quick application to read a Excel file and update a Web Service. Typically I would have done this in Groovy as a command line app. But I really wanted to put some of the information in a text field and have buttons to initiate different functions. Griffon allowed me to very quickly build a swing app.
I've been very successful this week in throwing together a quick application to read a Excel file and update a Web Service. Typically I would have done this in Groovy as a command line app. But I really wanted to put some of the information in a text field and have buttons to initiate different functions. Griffon allowed me to very quickly build a swing app.
I've not used Griffon for anything in the past. I have put together a couple of apps with Grails, but it's really not the same (close, but not the same). I've been waiting for Gorm to be ported to Griffon to use it for anything, but this project did not need any database access.
BTW, I used Poi for reading the Excel file and GroovyWS for accessing the Web Services. GroovyWS needs more work (especially in error handling), but it was sufficient for what I need to do. I covered another problem with GroovyWS here, and I dearly wish that one was fixed in the library itself.
Griffon is a Groovy-based framework for developing standalone Java applications similar to Grails. http://griffon.codehaus.org/
Grails is a Groovy-based framework for creating Web Applications. http://grails.org/
Groovy is a great programming language. http://groovy.codehaus.org/
Saturday, September 12, 2009
To remember
From a conversation on the grails list, but I keep forgetting about this ability in groovy, so I'll paste it here so I remember it and research it.
Date.metaClass.getAge = { new Date().year - delegate.year }
println new Date(79, 11, 17).age
Date.metaClass.getAge = { new Date().year - delegate.year }
println new Date(79, 11, 17).age
Friday, September 11, 2009
iTunes 9 lost smart playlist on my iPod, who are they?
I updated to iTunes 9 last night.
When I got to work this morning, I found that the smart playlist I have all the podcasts and other audio/video files I want to listen to during the day, in the order I want to listen to them, was empty. They were in the playlist in iTunes when I sync and disconnected this morning, but for some reason, the list was empty on my iPod.
All of the files seem to be there, I just have to go find them on the iPod and play them individually.
With Apple fighting with Palm about who can sync to iTunes, and then breaking something that I've used for years, I can't help but feel that Apple is becoming more and more like Microsoft. Argggh.
When I got to work this morning, I found that the smart playlist I have all the podcasts and other audio/video files I want to listen to during the day, in the order I want to listen to them, was empty. They were in the playlist in iTunes when I sync and disconnected this morning, but for some reason, the list was empty on my iPod.
All of the files seem to be there, I just have to go find them on the iPod and play them individually.
With Apple fighting with Palm about who can sync to iTunes, and then breaking something that I've used for years, I can't help but feel that Apple is becoming more and more like Microsoft. Argggh.
Thursday, September 3, 2009
OS Update
Found out why OpenSolaris 117 and greater will not run on my laptop. There has been a bug reported where certain motherboards cause the same problem. I will have to wait until they get around to fixing that bug to upgrade to that version of OpenSolaris.
Because of this, and because I've picked up a contract that requires me to work in Windows, I have to come up with another plan. Windows becomes a problem because I'm running Vista under VBox on OpenSolaris. For various reasons I won't go into now, I will not run Vista next to the metal. But since I only have 2G of onboard memory in the laptop, if I give a VBox session more than 1/2G OpenSolaris begins swapping like crazy. With 1/2G, Vista really can't do more than one or two things at the same time. Fine for what I was using Vista for, but Java development requires a bit more.
My plan, which will probably start after a couple of the checks from that contract come in, is to start purchasing parts each month to build a new computer, i.e. purchase a case next month, a motherboard the next, and so on.
It looks like I can put together a pretty fast system, with about 8G of memory which is important, for about $700, but paid for over a 6 to 7 month period. Running OpenSolaris next to the metal, I can put Win7 in a virtual box and give it 2G, and even run Linux with 1/2G and keep them both running most of the time.
Then I can reformat the laptop to FreeBSD or Linux (I'll try FreeBSD, but if I can't get the wifi to work, try Ubuntu). Using X, I can log into the big machine from the laptop or our (really old) iMac when I need the power. Then the kids can use any for their homework or web-surfing and we are not tying up one of the systems.
Because of this, and because I've picked up a contract that requires me to work in Windows, I have to come up with another plan. Windows becomes a problem because I'm running Vista under VBox on OpenSolaris. For various reasons I won't go into now, I will not run Vista next to the metal. But since I only have 2G of onboard memory in the laptop, if I give a VBox session more than 1/2G OpenSolaris begins swapping like crazy. With 1/2G, Vista really can't do more than one or two things at the same time. Fine for what I was using Vista for, but Java development requires a bit more.
My plan, which will probably start after a couple of the checks from that contract come in, is to start purchasing parts each month to build a new computer, i.e. purchase a case next month, a motherboard the next, and so on.
It looks like I can put together a pretty fast system, with about 8G of memory which is important, for about $700, but paid for over a 6 to 7 month period. Running OpenSolaris next to the metal, I can put Win7 in a virtual box and give it 2G, and even run Linux with 1/2G and keep them both running most of the time.
Then I can reformat the laptop to FreeBSD or Linux (I'll try FreeBSD, but if I can't get the wifi to work, try Ubuntu). Using X, I can log into the big machine from the laptop or our (really old) iMac when I need the power. Then the kids can use any for their homework or web-surfing and we are not tying up one of the systems.
Wednesday, August 26, 2009
Using Ubiquity for Retweets
In the category of an easier way of doing something easy, if you use Ubiquity, you probably know you can use it to tweet. I've found the if you want to retweet something, from the website before they update it to add retweets, you can select the original tweet, including the original authors name. Then trigger ubiquity and enter "Twitter RT @this".
Monday, August 17, 2009
Writing Unit-Tests for Java in Groovy: Great for Web Services
Update, moved to Just Thinking: Code
Written over at Closed Loop: Writing Unit-Tests for Java in Groovy: Not so brilliant after all?
Written over at Closed Loop: Writing Unit-Tests for Java in Groovy: Not so brilliant after all?
I've been using Groovy to Unit test Web Services for several months now. Groovy WS allows me to quickly put together a Unit Test for a Web Service, saved in a text file so when I need to document my tests, I have it handy. Also, if I have to change something, I can test that change quickly.
Saturday, August 1, 2009
My review of GF coffee cake
Here are my thoughts on the coffee cake my wife made. The recipe is here Gluten Free Coffee cake I from Betty Crocker GF mix.
When we first tried the cake mix, I had thought that the texture was very much like coffee cake. Sure enough, the mix does well by this.
A couple of things that I think may be worked out. It was a bit crumbly more or less right out of the oven. This may fix itself as it is allowed to sit. We saved some for later, so we'll know then.
It was a bit too sweet. I think it's because there was a little too much streusel on top (the recipe reflects this adjustment). Also, I think next time we are going to try brown sugar instead of granulated sugar. Toasted pecans would be a great addition to the streusel, but both kids hate nuts.
The kids had two pieces each and asked for more. Since the main goal of this was to try to find Gluten-free replacement foods for the kids, I would say this is a success.
The taste was quite delicious. No bad aftertaste, as some GF foods can have. As I said before, the texture was very good for a coffee cake.
Eating it with some protein or dairy will keep this low GI (and some coffee, just because) and you have a great weekend morning breakfast.
My wife, who does not have to be gluten-free, is wonderful for the work she did on this and all the experiments we are doing to go gluten-free.
When we first tried the cake mix, I had thought that the texture was very much like coffee cake. Sure enough, the mix does well by this.
A couple of things that I think may be worked out. It was a bit crumbly more or less right out of the oven. This may fix itself as it is allowed to sit. We saved some for later, so we'll know then.
It was a bit too sweet. I think it's because there was a little too much streusel on top (the recipe reflects this adjustment). Also, I think next time we are going to try brown sugar instead of granulated sugar. Toasted pecans would be a great addition to the streusel, but both kids hate nuts.
The kids had two pieces each and asked for more. Since the main goal of this was to try to find Gluten-free replacement foods for the kids, I would say this is a success.
The taste was quite delicious. No bad aftertaste, as some GF foods can have. As I said before, the texture was very good for a coffee cake.
Eating it with some protein or dairy will keep this low GI (and some coffee, just because) and you have a great weekend morning breakfast.
My wife, who does not have to be gluten-free, is wonderful for the work she did on this and all the experiments we are doing to go gluten-free.
Gluten Free Coffee cake I from Betty Crocker GF mix
This is the recipe my wife used.
For Streusel:
1/2 cup sugar
1/4 cup gluten free baking mix ( I used pancake mix)
2 T. butter (cold)
1 Teaspoon Cinnamon ( more to taste)
For cake:
Betty Crocker gluten free cake mix
2/3 cup water
1 stick (1/2 cup) butter - softened
1 teaspoon vanilla - gluten free
3 eggs
Combine streusel ingredients with fork or hands to crumbly consistency, put aside.
Combine cake ingredients.
Grease a cake pan, ( I line mine with parchment paper)
Pour half cake mixture into pan, sprinkle half of the streusel mixture on top of the cake mix.
Pour the rest of the cake mix on top of the streusel layer and top with remaining streusel.
Bake in 350 oven 45 minutes (checking at 40) or more until toothpick comes out clean. Cool a bit and serve.
For Streusel:
1/2 cup sugar
1/4 cup gluten free baking mix ( I used pancake mix)
2 T. butter (cold)
1 Teaspoon Cinnamon ( more to taste)
For cake:
Betty Crocker gluten free cake mix
2/3 cup water
1 stick (1/2 cup) butter - softened
1 teaspoon vanilla - gluten free
3 eggs
Combine streusel ingredients with fork or hands to crumbly consistency, put aside.
Combine cake ingredients.
Grease a cake pan, ( I line mine with parchment paper)
Pour half cake mixture into pan, sprinkle half of the streusel mixture on top of the cake mix.
Pour the rest of the cake mix on top of the streusel layer and top with remaining streusel.
Bake in 350 oven 45 minutes (checking at 40) or more until toothpick comes out clean. Cool a bit and serve.
Friday, July 17, 2009
OS problem update
I installed the 118 build of OpenSolaris last night and it still would not boot. I resent my request for help to the OpenSolaris Discussion list instead of the Help list. I got 2 suggestions to try this weekend. Hopefully, I will not have to change operating systems, at least until Oracle kills OpenSolaris.
Full Circle
Back in the early 90's, I really started paying attention to the industry that I made my career in. Windows 3.0 and OS/2 were both out and based on a opinion piece I read in PC Mag (no, not by Dvorak) I got my boss to buy a copy of OS/2 to work on. At the time, I had moved from being a operator on a Wang mainframe, to an administrator on a Novell network and a programmer and assisting the Wang staff.
Compuserve was the medium of choice for online discussions, especially technical ones (although I met two of my favorite sci-fi authors on Compuserve and I extremely regret not staying in touch with both of them).
The more I read about that Northwestern software company, both online and in PC Mag and such, the more horrified I became. One technique that I really thought was terribly egregious was to release an updated version of their software that has no effect but to break other software. When Windows went from 3.1 to 3.1.1, they said it was to refresh the drivers. However, OS/2 for Windows stopped working. How many times did they change their word processor document format so that import/export in other word processors were broken?
I was never a Apple fan during this time, just because their software did not work the same way I did. To this day, I open several software applications at once and switch through them as I need them. I did not find that easy to do on a Mac pre OSX.
So I used OS/2 until it just did not make any sense any more. In the late 90's, I bought a Dell and was suddenly running Windows at home outside a virtual environment for the first time. (I went from TRS-DOS to DOS to DR-DOS to OS/2). That survived for just under a year. A friend introduced me to FreeBSD, which I ran for several years. A few years later, I convinced my boss (different boss) to let me use a Mac at work because I wanted to try out the new Mac OSX because it was based on FreeBSD. A year later, using a bonus, I purchased 2 new Macs for home. Currently I'm running one of those Macs and OpenSolaris on a Gateway Laptop.
Although I'm still not a Apple fan, I really do like their hardware and OSX. I own an iPod, and if the iPhone was on Verizon, would probably own one of those (if Verizon gets a gPhone first, I may never have an iPhone).
Just recently Apple has put out a new version of iTunes that has, as far as I can tell, the single purpose of breaking the Palm Pre's ability to sync with it. Yes, Apple controls iTunes and it is very much in their rights to do so, but why do it? Not so much break the syncing, but why put out a version just to do that. It should be so beneath a mature, honorable company. Reminds me so much of that other company.
Will this, by itself, keep me from buying Apple products. No. But it does make me start to worry about where they are going and what kind of company will they be. It very much reminds me of where I started.
Compuserve was the medium of choice for online discussions, especially technical ones (although I met two of my favorite sci-fi authors on Compuserve and I extremely regret not staying in touch with both of them).
The more I read about that Northwestern software company, both online and in PC Mag and such, the more horrified I became. One technique that I really thought was terribly egregious was to release an updated version of their software that has no effect but to break other software. When Windows went from 3.1 to 3.1.1, they said it was to refresh the drivers. However, OS/2 for Windows stopped working. How many times did they change their word processor document format so that import/export in other word processors were broken?
I was never a Apple fan during this time, just because their software did not work the same way I did. To this day, I open several software applications at once and switch through them as I need them. I did not find that easy to do on a Mac pre OSX.
So I used OS/2 until it just did not make any sense any more. In the late 90's, I bought a Dell and was suddenly running Windows at home outside a virtual environment for the first time. (I went from TRS-DOS to DOS to DR-DOS to OS/2). That survived for just under a year. A friend introduced me to FreeBSD, which I ran for several years. A few years later, I convinced my boss (different boss) to let me use a Mac at work because I wanted to try out the new Mac OSX because it was based on FreeBSD. A year later, using a bonus, I purchased 2 new Macs for home. Currently I'm running one of those Macs and OpenSolaris on a Gateway Laptop.
Although I'm still not a Apple fan, I really do like their hardware and OSX. I own an iPod, and if the iPhone was on Verizon, would probably own one of those (if Verizon gets a gPhone first, I may never have an iPhone).
Just recently Apple has put out a new version of iTunes that has, as far as I can tell, the single purpose of breaking the Palm Pre's ability to sync with it. Yes, Apple controls iTunes and it is very much in their rights to do so, but why do it? Not so much break the syncing, but why put out a version just to do that. It should be so beneath a mature, honorable company. Reminds me so much of that other company.
Will this, by itself, keep me from buying Apple products. No. But it does make me start to worry about where they are going and what kind of company will they be. It very much reminds me of where I started.
Thursday, July 16, 2009
Changing OS's
Have not reformatted the laptop yet to change OS's. We have a test coming up at work that we need to hit the website from machines outside the firewall. I don't want to take a chance of the laptop not being working fully when that test happens.
Also, it's a lot of work to move to a new operating system. Now I know why most people really balk at that when I suggest they try a new OS, like BSD or Linux. When something works and it takes a lot of work to go to something that might be better, making the change is daunting.
Tuesday, July 7, 2009
Thinking of moving back to FreeBSD
I've been running OpenSolaris on my laptop for the last year. I've really liked several features a lot, but several problems have cropped up,and the latest one may make me look into going back to FreeBSD.
I upgraded from version 111b to 117 recently and when I rebooted, the boot failed. It appears to failing at the during the zfs initialization. Luckily the way OpenSolaris updates, the previous version is there to boot to (just select it from Grub during the boot). I've tried the update several times and get the same result every time.
It's not the failed upgrade that bothers me so much, although if the next one failed too, it would be a show stopper for me. It's the inability to get help. I think I've posted 3 messages to the help list for OpenSolaris for different problems over the last year. One time I got, "we don't support that and probably never will", and the other 2 (including this latest) were never responded to. If I can't find the answer online, and can't get an answer from the lists, it makes me nervous in running the operating system.
Yes, I know it's a free and I'm not paying for support, so I can't complain about it. However, if I can fix some specific problems, I can't use the operating system. I'm not even suggesting someone else not use it; quite the contrary, I often suggest it to people. And if I ever get another desktop with enough RAM, my plan is to run OpenSolaris against the metal and run a couple of Virtual Boxes all the time to do different work (programming in one, email and writing in one, gaming, etc).
Some things that are giving me headaches that hopefully FreeBSD will fix.
Some things that I will miss, and are keeping me from just moving anyway.
I upgraded from version 111b to 117 recently and when I rebooted, the boot failed. It appears to failing at the during the zfs initialization. Luckily the way OpenSolaris updates, the previous version is there to boot to (just select it from Grub during the boot). I've tried the update several times and get the same result every time.
It's not the failed upgrade that bothers me so much, although if the next one failed too, it would be a show stopper for me. It's the inability to get help. I think I've posted 3 messages to the help list for OpenSolaris for different problems over the last year. One time I got, "we don't support that and probably never will", and the other 2 (including this latest) were never responded to. If I can't find the answer online, and can't get an answer from the lists, it makes me nervous in running the operating system.
Yes, I know it's a free and I'm not paying for support, so I can't complain about it. However, if I can fix some specific problems, I can't use the operating system. I'm not even suggesting someone else not use it; quite the contrary, I often suggest it to people. And if I ever get another desktop with enough RAM, my plan is to run OpenSolaris against the metal and run a couple of Virtual Boxes all the time to do different work (programming in one, email and writing in one, gaming, etc).
Some things that are giving me headaches that hopefully FreeBSD will fix.
- Cannot run some programs, like Gnucash and TweetDeck, native. I have to setup a VirtualBox running Linux.
- Programs not updated to latest, i.e. pidgin.
- My wireless card is not, and probably never will be supported.
- Power management on AMD64 not supported.
Some things that I will miss, and are keeping me from just moving anyway.
- VirtualBox under OpenSolaris works really well.
- ZFS. By far the best way to format a disk. Snapshots are especially useful. I've seen posts that ZFS is now supported under FreeBSD, just not on the main drive. Hopefully I can setup a home directory with it.
- Java just works, and is relatively easy to setup (have you ever done that on BSD?)
- The update process. Using ZFS to setup a new mountpoint to install to, so that the previous version is not overwritten and can be booted to is brilliant. Really makes upgrading a no stress operation.
CSV Export in Bugzilla
Bugzilla was incorrectly exporting CSV files so that Excel could not understand them. It was adding extra characters to the file.
The problem was because of the file format of bugzilla\template\en\default\list\list.csv.tmpl, which on Windows is Dos. Open the file in an editor that can change file format, such as Vim, change the file format to Unix and save the file.
The problem was because of the file format of bugzilla\template\en\default\list\list.csv.tmpl, which on Windows is Dos. Open the file in an editor that can change file format, such as Vim, change the file format to Unix and save the file.
Wednesday, June 17, 2009
Start work
I finished a podcast about one of my favorite authors (Jim Butcher) and you get a glimpse into his life and one again I am struck that no only do I find the prospect of a career as a writer appealing, the life of a successful author is very appealing. Yes, I realize you can say that the life of anyone successful would be "appealing". I really mean something different by that.
So how I've approached a career as a writer so far has not been successful. Basically hoping I feel better enough, have the time, and the stories come to me is not working. I can no longer blame depression from Gluten Intolerance on it.
Time to really get to work. And time to do it like the professionals do. Have to figure how what that is.
So how I've approached a career as a writer so far has not been successful. Basically hoping I feel better enough, have the time, and the stories come to me is not working. I can no longer blame depression from Gluten Intolerance on it.
Time to really get to work. And time to do it like the professionals do. Have to figure how what that is.
Thursday, May 21, 2009
Complex elements in Groovy WS
Update, moved to Just Thinking: Code
I've been trying to use GroovyWS to test Web Services we are creating. Because of the way we coded the Web Services, I could not use the examples that are online, even the ones that are labeled "Complex objects".
If I used :
object.value = "value"
I would get an exception about not being able to convert the value to a javax.xml.bind.JAXBElement
I finally got to a point that I really needed to use some type of scripting language to access the Web Services, or create an entire application in Java to do it. I decided to take a good look at why I could use Groovy. Here is an example as to how I got it to work. It may not be very Groovy, so any suggestions as to how to make it more Groovy are appreciated. I hope this helps someone.
import groovyx.net.ws.WSClient
def getProxy(wsdl, classLoader) {
new WSClient(wsdl, classLoader)
}
def element(tagName, value) {
new javax.xml.bind.JAXBElement(new javax.xml.namespace.QName(tagName), value.class, value)
}
proxy = getProxy('http://localhost/ServicePort?WSDL', this.class.classLoader)
proxy.initialize()
def sampleData = proxy.create("com.sample.application.Sample")
sampleData.name = element("Name", "Item One")
sampleData.type = element("Type", "Misc");
result = proxy.store(sampleData)
println result.
I've been trying to use GroovyWS to test Web Services we are creating. Because of the way we coded the Web Services, I could not use the examples that are online, even the ones that are labeled "Complex objects".
If I used :
object.value = "value"
I would get an exception about not being able to convert the value to a javax.xml.bind.JAXBElement
I finally got to a point that I really needed to use some type of scripting language to access the Web Services, or create an entire application in Java to do it. I decided to take a good look at why I could use Groovy. Here is an example as to how I got it to work. It may not be very Groovy, so any suggestions as to how to make it more Groovy are appreciated. I hope this helps someone.
import groovyx.net.ws.WSClient
def getProxy(wsdl, classLoader) {
new WSClient(wsdl, classLoader)
}
def element(tagName, value) {
new javax.xml.bind.JAXBElement(new javax.xml.namespace.QName(tagName), value.class, value)
}
proxy = getProxy('http://localhost/ServicePort?WSDL', this.class.classLoader)
proxy.initialize()
def sampleData = proxy.create("com.sample.application.Sample")
sampleData.name = element("Name", "Item One")
sampleData.type = element("Type", "Misc");
result = proxy.store(sampleData)
println result.
Subscribe to:
Posts (Atom)