I played with JBossWS for the first time this evening. I'm runningEclipse with JBossTools installed. It was easy enough to compile (Ant task) and import the project into Eclipse.
However, when I ran the tests I got a "Java Virtual Machine Error." The popup read "Could not find the main class. Program will exit." There's an post about this in the JBoss forums but no answer.
The tests run from Ant (even within Eclipse.) While running the tests from the command line a second time I noticed the following message :
tests-prepare: [echo] [echo] ----------------------------------------------- [echo] jboss.home = C:/tools/servers/jboss/jboss-4.2.3.GA [echo] excludesfile = C:\tools\jbossws\jbossws-native-3.0.4.GA\jbossws-native-bin-dist/tests/resources/test-exclude s-jboss423.txt [echo] java.home = C:\tools\java\j2se5.0u16\jre
It's pointing to the jre of my java home for some reason. I check the environment variable by running, echo %JAVA_HOME%, but it is pointing to the base install not just the jre.
Searching through the project for "jre" doesn't return anything. I hate to give up before I find a solution, but I had stuff to get done.
I ran the "ant eclipse" task again and imported into a fresh Eclipse install. No problem running the tests.
I'll try to reproduce and file a Jira issue. I thought I'd post this just in case anyone else is banging their head against the same wall.
Tuesday, October 21, 2008
Thursday, October 16, 2008
Running Eclipse in a full JDK
After installing the Maven plugin I got a warning that Eclipse should run in a full jdk. The solution is really simple (and on the Eclipse wiki), and I was kind of surprised I hadn't run into this before.
Simply add the following to eclipse.ini (found in the Eclipse install folder) :
-vm
path-to-your-jdk (C:\tools\java\j2se5.0u16\bin\javaw.exe for example)
Simply add the following to eclipse.ini (found in the Eclipse install folder) :
-vm
path-to-your-jdk (C:\tools\java\j2se5.0u16\bin\javaw.exe for example)
Blogged with the Flock Browser
Thursday, September 25, 2008
gVim
Want to change your font in gVim? Here's how. I love the title of that page, "Troubleshooters.com and T.C Linux Library Present Permananetly Changing Your Graphical Vim Font"
If you want to change the color scheme, edit your _vimrc file on Windows, which is located in : C:\Program Files\Vim. Simply add "colors [name of the color theme you want to use]." The themes themselves can be found in C:\Program Files\Vim\vim72\colors. I like "darkblue."
If you want to change the color scheme, edit your _vimrc file on Windows, which is located in : C:\Program Files\Vim. Simply add "colors [name of the color theme you want to use]." The themes themselves can be found in C:\Program Files\Vim\vim72\colors. I like "darkblue."
Blogged with the Flock Browser
Seam-gen, HSQLDB and development schemas
I like using HSQLDB's in memory db for early development. Changes the annotations on my entities and letting hbm2ddl create the schema (tables actually which is what this post is about) for me is way useful. One of the best things about Seam IMHO.
I ran into an error in my curent project which I set up using seam-gen and giving it a schema name of "PROJECTDEV." After creating an entity class, "Job" I ran "seam generate-ui" from my project directory. I deployed expecting to see the default crud screens that seam generates. However, when I clicked on the "Job List" link I got an error. The console told me something was wrong with my schema :
Caused by: java.sql.SQLException: invalid schema name in statement
And looking further back in the logs I found error messages from Seam while the schema export was running:
[SchemaExport] invalid schema name: PROJECTDEV in statement
Poking around the web I found some references to this problem on the Hibernate forums, JBoss forums and JBoss Jira.
I tried putting :
CREATE SCHEMA PROJECTDEV AUTHORIZATION DBA;
in my import.sql file, but that didn't work. Same errors.
I had to create the schema manually in the HSQLDB database manager (I have a post on how to use this if you don't already know how.) After that everything worked fine.
I ran into an error in my curent project which I set up using seam-gen and giving it a schema name of "PROJECTDEV." After creating an entity class, "Job" I ran "seam generate-ui" from my project directory. I deployed expecting to see the default crud screens that seam generates. However, when I clicked on the "Job List" link I got an error. The console told me something was wrong with my schema :
Caused by: java.sql.SQLException: invalid schema name in statement
And looking further back in the logs I found error messages from Seam while the schema export was running:
[SchemaExport] invalid schema name: PROJECTDEV in statement
Poking around the web I found some references to this problem on the Hibernate forums, JBoss forums and JBoss Jira.
I tried putting :
CREATE SCHEMA PROJECTDEV AUTHORIZATION DBA;
in my import.sql file, but that didn't work. Same errors.
I had to create the schema manually in the HSQLDB database manager (I have a post on how to use this if you don't already know how.) After that everything worked fine.
Blogged with the Flock Browser
Friday, September 19, 2008
DBUnit and slf4j
I had never heard of slf4j before this morning, and I have no idea why. I'm usually pretty up on stuff.
I started to pull some test data with dbunit ( in case you aren't familiar with dbunit here's an excellent intro by Bill Siggelkow ), and when I ran it I got the following error :
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.dbunit.database.AbstractDatabaseConnection.<clinit>(AbstractDatabaseConnection.java:46)
at [my package and class].main(DBUnitExporter.java:62)
The solution is to download slf4j, and add slf4j-api-1.5.2.jar and slf4j-log4j12-1.5.2.jar to the classpath (I'm using Eclipse so I threw it in the run dialog.)
I started to pull some test data with dbunit ( in case you aren't familiar with dbunit here's an excellent intro by Bill Siggelkow ), and when I ran it I got the following error :
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.dbunit.database.AbstractDatabaseConnection.<clinit>(AbstractDatabaseConnection.java:46)
at [my package and class].main(DBUnitExporter.java:62)
The solution is to download slf4j, and add slf4j-api-1.5.2.jar and slf4j-log4j12-1.5.2.jar to the classpath (I'm using Eclipse so I threw it in the run dialog.)
Blogged with the Flock Browser
Monday, July 21, 2008
HIbernate join tables or xref tables or cross reference tables or cross-reference tables
I just spent a bit of time figuring out how to do bidirectional one-to-many mappings that are associated with a join table / xref / cross reference / cross-reference (I'm spelling all of these out in the event that some other poor soul is searching those terms) and exist in separate schemas.
Its actually spelled out (not the separate schema part, but that's easy) on the hibernate site which shouldn't be surprising since its an excellent site.
There are two tricks to making this work :
In my case this meant something along the lines of this in the parent :
<set name="children" table="XREF" schema="PARENT_SCHEMA"
lazy="false" inverse="true">
<key column="XREF_PARENT_ID" not-null="true" />
<many-to-many unique="true" column="XREF_CHILD_ID" class="com.jeremyrdavis.Child" />
</set>
And this in the child :
<join table="PARENT_SCHEMA.XREF" inverse="true" optional="true" >
<key column="XREF_CHILD_ID" not-null="true" />
<many-to-one name="group" column="XREF_PARENT_ID" not-null="true"></many-to-one>
</join>
Its actually spelled out (not the separate schema part, but that's easy) on the hibernate site which shouldn't be surprising since its an excellent site.
There are two tricks to making this work :
- Map the children into the parent as a many-to-many, but set "unique='true'" in the mapping.
- Map the join table into the child object.
In my case this meant something along the lines of this in the parent :
<set name="children" table="XREF" schema="PARENT_SCHEMA"
lazy="false" inverse="true">
<key column="XREF_PARENT_ID" not-null="true" />
<many-to-many unique="true" column="XREF_CHILD_ID" class="com.jeremyrdavis.Child" />
</set>
And this in the child :
<join table="PARENT_SCHEMA.XREF" inverse="true" optional="true" >
<key column="XREF_CHILD_ID" not-null="true" />
<many-to-one name="group" column="XREF_PARENT_ID" not-null="true"></many-to-one>
</join>
Blogged with the Flock Browser
Wednesday, July 16, 2008
Terracotta at July's AJUG
Last Tuesday's AJUG (that's the Atlanta Java User's Group) presentation by Kunal Bhasin, a field engineer at Terracotta, ruled. First of all, Kunal did a bang up job of fielding a ton of questions, and most of crowd stayed around an extra half hour for his presentation. Second, Terracotta has a seriously cool app.
I've attend AJUG regularly (meaning most of them) for the past few years. Burr Sutter who runs AJUG and is the product manager for JBoss ESB does a great job with the speakers, but there have been a few that really stand out. I got introduced to both Hibernate and Spring (although I had read about Hibernate previously) a few years back at AJUG meetings, and on both occasions got the feeling that those technologies were not only worth using but would be really big. I got a similar impression about Terracotta; although, its nothing like either Hibernate or Spring. Its actually pretty invisible to developers, which is the point.
In a nutshell (echoes of O'Reilly?) Terracotta's server(s) controls the objects for numerous JVMs allowing applications from each to access the same instances without any special apis. I'm sure there's plenty of information on their site, and if you are an architect or have had to worry about clustering, caching or scaling then check it out. They have separate sites for the commercial and open source versions (a lot like JBoss.com and JBoss.org - is this going to be the standard for oss business models now?)
Bill Sengstacken, who is in marketing, is going to post a video, and there should be a link on the AJUG site at some point.
Subscribe to:
Posts (Atom)