Aleksander Adamowski

Greenhorn
+ Follow
since Jun 25, 2008
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 Aleksander Adamowski

Bhavik patel wrote:
Well , I have managed to resolve this issue by now.

The ebjs which were not getting deployed had following structure in their jar file.

SearchEngine.jar-------METAINF ( directory)
--------MANIFEST.MF ( file )
--------Jboss.xml
-------org ( and other package)


I removed this METAINF ( directory) from src -> conf

and compiled the ejb project, and placed resulted SearchEngine.jar in Deploy directory of Jboss5 serve and previous exception is gone.



Hi!

I had a similar problem when porting an application from JBoss 4.2.

See this JIRA comment for detailed explanation:
https://jira.jboss.org/browse/JBAS-5980?focusedCommentId=12543977&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12543977

In short, one of EJB JARs had a leftover jboss.xml descriptor which didn't contain any significant data. It seems that on JBoss 5 its presence borks the deployment process.
13 years ago
What's intriguing, I've seen people claim they get automatically generated primary keys on Hypersonic even when JBoss CMP takes care of creating tables - just by using entity-command name="hsqldb-fetch-key" on the entity and auto-increment on the PK field.

Example:

http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966842#3966842

In my case with similar configuration JBoss was creating a table where the PK was an ordinary BIGINT field; then in INSERTs it was omitting the PK field and as a result I were getting a SQL error:



Any idea what these people do differently so they don't have to create the PK column by hand and still get automatically incrementing primary keys?
[ June 25, 2008: Message edited by: Aleksander Adamowski ]
15 years ago
Hi!

I've found out that one can use post-table-create element in jbosscmp-jdbc.xml to alter the primary key right after table creation to make it auto increment.

Here's the relevant fragment of my XDoclet specification for the entity EJB class:



And here's how the ejbCreate() methods and primary key (productPk) getter look like:




Notice that I've used the %%t placeholder in the SQL code that will be substituted with the actual table name that JBoss will choose when generating tables.

There's no placeholder for the primary key column name, so one either has to guess, or deploy the app first without the post-table-create, then see what column name gets generated.

This is for Hypersonic but this technique can obviously be adapted to any RDBMS.

BTW, it would be nice if that trick would be documented in http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configuration_Guide/Entity_Commands_and_Primary_Key_Generation-Existing_Entity_Commands.html...
[ June 25, 2008: Message edited by: Aleksander Adamowski ]
15 years ago