[JBoss Tools (users)] - Hibernate reverse engineering errors
by bdlink
For the last couple of years, I have been trying hibernate reverse engineering on a test database with seam-gen or JBT. It is improving, but does not work out of the box. (work, in terms of generating examples that will compile). I think all of the issues are in JIRA.
At the moment I am trying to get the hibernate.reveng.xml to customize the reverse engineering so it will be as desired. I have read the Hibernate Tools Reference Guide version 3.2.4.CR2 from the JBoss Tools CR2 Doc site, as well as the one at Hibernate.org (which is quite similar). Neither has a detailed reference on how to specify the reverse engineering of relationships. The hibernate reverse engineering editor (part of Hibernate tools) does not seem to deal with this aspect, so I have been trying to use the source window to add <foreign-key> elements appropriately.
I get the following error when I try to generate the entities:
Exception while generating code
| Reason:
| org.hibernate.MappingException: Could not configure overrides from file: C:\apps\workspace3.4.2\infosys-ejb\.settings\hibernate.reveng.xml
| Could not configure overrides from file: C:\apps\workspace3.4.2\infosys-ejb\.settings\hibernate.reveng.xml
| org.hibernate.MappingException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| org.hibernate.MappingException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| String index out of range: 0
|
This is using 3.0.x branch nightly on top of eclipse 3.4.2
Unfortunately, this error does not help me figure out what I did wrong.
I am currently searching for the DTD, but if there is some more detailed documentation I have not found, that would be appreciated.
A useful addition to the documentation would be examples of how to reverse engineer:
1. OneToOne unidirectional
2. OneToOne bidirectional
3. OneToMany unidirectional
4. ManyToOne unidirectional
5. OneToMany bidirectional
6. ManyToMany unidirectional
7. ManyToMany bidirectional
How should one reverse engineer JoinTable mapping in all of the above, as well as foreign key mapping, and primary key join columns where those are appropriate?
Is it possible to specify how to handle composite primary keys (@IdClass vs. @EmbeddedId)?
Also, how to specify the type of collection (Collection, Set, List, Map)?
Also wonderful would be how to reverse engineer inheritance strategies (SINGLE_TABLE, TABLE_PER_CLASS, JOINED)
Finally, is it possible to reverse engineer an entity with properties from multiple tables (@SecondaryTable)?
The reason for all of these questions, is that there is the large ripple effect to generated artifacts when the relationships are not as desired. The current default seems to aggressively add reverse engineered relationships (even in the absence of foreign key constraints in the DB), so knowing how to eliminate undesired ones is also important.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215530#4215530
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215530
17 years, 4 months
[Installation, Configuration & DEPLOYMENT] - Re: Why does Jboss cleanly/gracefully shuts down
by mohitanchlia
REPOSTING IT with CODE TAGS:
We have apache server that talks over mod_jk to Jboss. When we shutdown Jboss we see 503 from Jboss as listed below.
It looks like Jboss accepts new connection when
it already undeployed the service. Is there something that I need to configure or do in Jboss so that it first stops taking new requests and then undeploys the service.
I see the following of http code 503 on web server that came from Jboss:
| <html><head><title>JBossWeb/2.0.0.GA_CP01 - Error
| report</title><style><!--H1
| {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
| H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
| H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
| BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
| B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
| P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
| {color : black;}A.name {color : black;}HR {color :
| #525D76;}--></style> </head><body><h1>HTTP Status 503 - This
| application is not currently available</h1><HR size="1"
| noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b>
| <u>This application is not currently
| available</u></p><p><b>description</b> <u>The requested service (This
| application is not currently available) is not currently
| available.</u></p><HR size="1"
| noshade="noshade"><h3>JBossWeb/2.0.0.GA_CP01</h3></body></html>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215509#4215509
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215509
17 years, 4 months
[Installation, Configuration & DEPLOYMENT] - Why does Jboss cleanly/gracefully shuts down
by mohitanchlia
We have apache server that talks over mod_jk to Jboss. When we shutdown Jboss we see 503 from Jboss as listed below.
It looks like Jboss accepts new connection when
it already undeployed the service. Is there something that I need to configure or do in Jboss so that it first stops taking new requests and then undeploys the service.
I see the following of http code 503 on web server that came from Jboss:
JBossWeb/2.0.0.GA_CP01 - Error
report<!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}HR {color :
#525D76;}--> <h1>HTTP Status 503 - This
application is not currently available</h1>type Status reportmessage
This application is not currently
availabledescription The requested service (This
application is not currently available) is not currently
available.<h3>JBossWeb/2.0.0.GA_CP01</h3>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215505#4215505
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215505
17 years, 4 months
[Security & JAAS/JBoss] - Re: Minimal JBoss config to use GSSAPI/Kerberos acceptSecCon
by chriscorbell
On Windows, the LoginContext loaded from the login-config.xml does in fact appear to be valid, even if it does not perform the same debug logging.
The LoginContext login() method also succeeds (this for a Krb5LoginModule configured with a local keyTab file).
However, the downstream GSSAPI calls do not seem to "know about" this. I can't explicitly create a GSSCredential with the service principal used in the login context, nor can I pass null to GSSManager.createContext() - in both cases I get
[GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos Key)]
Can anyone shed any light on the relation between upstream LoginContext login() and downstream GSSAPI calls, particularly on differences between running on Windows and POSIX (in my case, Mac OS X)? Or suggest anything else that might be required to make this work on Windows?
TIA,
Chris
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215499#4215499
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215499
17 years, 4 months
[JBoss AOP] - Re: Method Advised class on getInterceptorChainReadWriteLock
by Mike03
Regarding our issue with the ClassicInstrumentor and class loading:
We found a potential solution for this problem with a tweak to microcontainer/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java and updated https://jira.jboss.org/jira/browse/JBAOP-706 with a diff against a 2.0.4.GA checkout.
However, another issue came up when running our app with compile-time using the ClassicInstrumentor and optimized=true - we're getting the following ClassCastException during FieldWriteInvocation of one of our aspectized objects:
| 2009-03-05 12:21:57,221 DEBUG [com.company.common.item.aspect.TransactionalAspect] (main) Line: 582 main org.jboss.aop.ClassAdvisor cannot be cast to com.company.common.item.common.Item$ItemAdvisor
| java.lang.ClassCastException: org.jboss.aop.ClassAdvisor cannot be cast to com.company.common.item.common.Item$ItemAdvisor
| at com.company.common.item.common.Item.itemKey_w_$aop(Item.java)
| at com.company.common.item.common.Item.setItemKey(Item.java:44)
| at com.company.common.item.type.factory.ItemFactory.instantiate(ItemFactory.java:41)
| at com.company.common.cache.impl.LRUCache.getItem(LRUCache.java:236)
| at com.company.common.item.service.impl.ItemService.getItemFromItemKey(ItemService.java:679)
| at com.company.common.item.common.Container.createChildRelationship(Container.java:88)
| at com.company.common.item.common.ContainerItem.createChildRelationship(ContainerItem.java:72)
| at com.company.common.item.service.impl.ItemService.com$company$common$item$service$impl$ItemService$_createItem$aop(ItemService.java:268)
| at com.company.common.item.service.impl.ItemService.access$1(ItemService.java)
| at com.company.common.item.service.impl.ItemService$JoinPoint__createItem_N_6418346684073351391.dispatch(ItemService$JoinPoint__createItem_N_6418346684073351391.java)
| at com.company.common.item.aspect.TransactionalAspect.com$company$common$item$aspect$TransactionalAspect$trace$aop(TransactionalAspect.java:182)
| at com.company.common.item.aspect.TransactionalAspect$JoinPoint_trace5044930021793041279.dispatch(TransactionalAspect$JoinPoint_trace5044930021793041279.java)
| at com.company.rtl.perf.PerfMonitorAspect.trace(PerfMonitorAspect.java:56)
| at com.company.common.item.aspect.TransactionalAspect$TransactionalAspectAdvisor.trace5044930021793041279(TransactionalAspect$TransactionalAspectAdvisor.java)
| at com.company.common.item.aspect.TransactionalAspect.trace(TransactionalAspect.java)
| at com.company.rtl.perf.PerfMonitorAspect.trace(PerfMonitorAspect.java:56)
| at com.company.common.item.service.impl.ItemService$ItemServiceAdvisor._createItem_N_6418346684073351391(ItemService$ItemServiceAdvisor.java)
| at com.company.common.item.service.impl.ItemService$ItemServiceInstanceAdvisor._createItem_N_6418346684073351391(ItemService$ItemServiceInstanceAdvisor.java)
| at com.company.common.item.service.impl.ItemService._createItem(ItemService.java)
| at com.company.common.item.service.impl.ItemService.com$company$common$item$service$impl$ItemService$createItem$aop(ItemService.java:235)
| at com.company.common.item.service.impl.ItemService$JoinPoint_createItem6251048042645984084.dispatch(ItemService$JoinPoint_createItem6251048042645984084.java)
| at com.company.common.item.aspect.TransactionalAspect.com$company$common$item$aspect$TransactionalAspect$trace$aop(TransactionalAspect.java:182)
| at com.company.common.item.aspect.TransactionalAspect$JoinPoint_trace5044930021793041279.dispatch(TransactionalAspect$JoinPoint_trace5044930021793041279.java)
| at com.company.rtl.perf.PerfMonitorAspect.trace(PerfMonitorAspect.java:56)
| at com.company.common.item.aspect.TransactionalAspect$TransactionalAspectAdvisor.trace5044930021793041279(TransactionalAspect$TransactionalAspectAdvisor.java)
| at com.company.common.item.aspect.TransactionalAspect.trace(TransactionalAspect.java)
| at com.company.rtl.perf.PerfMonitorAspect.trace(PerfMonitorAspect.java:56)
| at com.company.common.item.service.impl.ItemService$ItemServiceAdvisor.createItem6251048042645984084(ItemService$ItemServiceAdvisor.java)
| at com.company.common.item.service.impl.ItemService$ItemServiceInstanceAdvisor.createItem6251048042645984084(ItemService$ItemServiceInstanceAdvisor.java)
| at com.company.common.item.service.impl.ItemService.createItem(ItemService.java)
| at com.company.system.executive.storage.impl.BasicExecutive.create(BasicExecutive.java:1635)
| at com.company.system.executive.storage.impl.ContainerExecutive.createChild(ContainerExecutive.java:760)
| at com.company.framework.impl.ItemComponentProvider.com$company$framework$impl$ItemComponentProvider$createComponentDataID$aop(ItemComponentProvider.java:334)
| at com.company.framework.impl.ItemComponentProvider$JoinPoint_createComponentDataID_N_1216227476944167699.dispatch(ItemComponentProvider$JoinPoint_createComponentDataID_N_1216227476944167699.java)
| at com.company.common.item.aspect.TransactionalAspect.com$company$common$item$aspect$TransactionalAspect$trace$aop(TransactionalAspect.java:195)
| at com.company.common.item.aspect.TransactionalAspect$JoinPoint_trace5044930021793041279.dispatch(TransactionalAspect$JoinPoint_trace5044930021793041279.java)
| at com.company.rtl.perf.PerfMonitorAspect.trace(PerfMonitorAspect.java:56)
| at com.company.common.item.aspect.TransactionalAspect$TransactionalAspectAdvisor.trace5044930021793041279(TransactionalAspect$TransactionalAspectAdvisor.java)
| at com.company.common.item.aspect.TransactionalAspect.trace(TransactionalAspect.java)
| at com.company.framework.impl.ItemComponentProvider$ItemComponentProviderAdvisor.createComponentDataID_N_1216227476944167699(ItemComponentProvider$ItemComponentProviderAdvisor.java)
| at com.company.framework.impl.ItemComponentProvider$ItemComponentProviderInstanceAdvisor.createComponentDataID_N_1216227476944167699(ItemComponentProvider$ItemComponentProviderInstanceAdvisor.java)
| at com.company.framework.impl.ItemComponentProvider.createComponentDataID(ItemComponentProvider.java)
| at com.company.framework.impl.ItemComponentProvider.upgradeComponentDataFromBootstrapComponentData(ItemComponentProvider.java:148)
| at com.company.policy.impl.UpgradeComponentData.init(UpgradeComponentData.java:42)
| at com.company.framework.init.impl.DefaultPhase.createComponentData(DefaultPhase.java:87)
| at com.company.policy.impl.BootstrapPhase.createComponentData(BootstrapPhase.java:99)
| at com.company.framework.impl.BaseProvider.initComponents(BaseProvider.java:450)
| at com.company.framework.impl.BaseProvider.init(BaseProvider.java:99)
| at com.company.framework.init.impl.DefaultPhase.init(DefaultPhase.java:46)
| at com.company.policy.impl.BootstrapPhase.init(BootstrapPhase.java:51)
| at com.company.framework.init.impl.DefaultPhaseProvider.initComponent(DefaultPhaseProvider.java:157)
| at com.company.framework.impl.BaseProvider.initComponents(BaseProvider.java:458)
| at com.company.framework.impl.BaseProvider.init(BaseProvider.java:99)
| at com.company.framework.init.impl.DefaultPhaseProvider.initializePhases(DefaultPhaseProvider.java:80)
| at com.company.framework.CoreSystem.init(CoreSystem.java:686)
| at com.company.framework.CoreSystem.main(CoreSystem.java:645)
| at com.company.framework.impl.CoreServlet.init(CoreServlet.java:83)
| at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
| at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
| at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:312)
| at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:144)
| at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
| at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
| at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at $Proxy36.start(Unknown Source)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
| at org.jboss.system.ServiceController.start(ServiceController.java:460)
| at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
| at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
| at org.jboss.Main.boot(Main.java:209)
| at org.jboss.Main$1.run(Main.java:547)
| at java.lang.Thread.run(Thread.java:619)
|
We looked at the src generated by JAD for the aspectized object and this particular cast was not apparent. Re-aop-compiling with optimized="false" allowed us to progress past this issue without the ClassCastExceptions.
We'll report back on our luck with the ClassicInstrumentor workaround for the original GeneratedAdvisor locking issue.
thanks, Mike
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215491#4215491
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215491
17 years, 4 months