[JBoss Portal] - error when changing identity data source
by JohnnyTheHun
System:
Windows (vista)
JBoss Portal + JBoss AS 4.2.2 bundle, freshly downloaded from jboss.
My goal: I want to store user(account) information in my database instead of bundled hsqldb. (In the long run I want to store all portal info in my db)
I looked at the reference, searched the forums to find a solution for changing the default hibernate user datasource to a postgresql datasource. I am quite new to jboss, so I probably don't understand the majority of the documents.
In the end what i did was:
1. created a new datasource called XyzDS, defined in portal-xyz-ds.xml
2. I modified
jboss-portal.sar\META-INF\jboss-service.xml
and put a
<depends>jboss.jca:service=DataSourceBinding,name=XyzDS</depends>
after each PortalDS ...PortalDS tag
3. I modified
jboss-portal.sar\conf\hibernate\user\hibernate.cfg.xml
i changed datasource to XyzDS and added auto update so that it creates the tables instead of me, and forced the dialect:
| <property name="connection.datasource">java:XyzDS</property>
| <property name="hbm2ddl.auto">update</property>
| <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
|
Every time I log in and try to do something it always throws the following exception:
| HTTP Status 500 -
|
| type Exception report
|
| message
|
| description The server encountered an internal error () that prevented it from fulfilling this request.
|
| exception
|
| javax.servlet.ServletException: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f5751ff:ee99:47c99ba6:26b status: ActionStatus.ABORT_ONLY >
| org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:406)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| root cause
|
| javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f5751ff:ee99:47c99ba6:26b status: ActionStatus.ABORT_ONLY >
| org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
| org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
| org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
| org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
| org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
| org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
| org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
| org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
| org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
| org.hibernate.loader.Loader.doQuery(Loader.java:673)
| org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
| org.hibernate.loader.Loader.loadEntity(Loader.java:1907)
| org.hibernate.loader.entity.CollectionElementLoader.loadElement(CollectionElementLoader.java:72)
| org.hibernate.persister.collection.OneToManyPersister.getElementByIndex(OneToManyPersister.java:360)
| org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:158)
| org.hibernate.collection.PersistentMap.get(PersistentMap.java:146)
| org.jboss.portal.core.impl.model.portal.PortalObjectImpl.getChild(PortalObjectImpl.java:382)
| org.jboss.portal.core.impl.model.portal.ContextImpl.getPortal(ContextImpl.java:52)
| org.jboss.portal.core.impl.model.CustomizationManagerService.getDashboard(CustomizationManagerService.java:282)
| org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.injectDashboardNav(PageCustomizerInterceptor.java:244)
| org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:164)
| org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:77)
| org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
| org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
| org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:51)
| org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
| org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
| org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
| org.jboss.portal.core.model.portal.PortalObjectResponseHandler.processCommandResponse(PortalObjectResponseHandler.java:74)
| org.jboss.portal.core.controller.classic.ClassicResponseHandler.processHandlers(ClassicResponseHandler.java:79)
| org.jboss.portal.core.controller.classic.ClassicResponseHandler.processCommandResponse(ClassicResponseHandler.java:53)
| org.jboss.portal.core.controller.handler.ResponseHandlerSelector.processCommandResponse(ResponseHandlerSelector.java:72)
| org.jboss.portal.core.controller.Controller.processCommandResponse(Controller.java:271)
| org.jboss.portal.core.controller.Controller.processCommand(Controller.java:259)
| org.jboss.portal.core.controller.Controller.handle(Controller.java:218)
| org.jboss.portal.server.RequestControllerDispatcher.invoke(RequestControllerDispatcher.java:51)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
| org.jboss.portal.core.cms.aspect.IdentityBindingInterceptor.invoke(IdentityBindingInterceptor.java:47)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:96)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:245)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.server.aspects.server.SignOutInterceptor.invoke(SignOutInterceptor.java:98)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.impl.api.user.UserEventBridgeTriggerInterceptor.invoke(UserEventBridgeTriggerInterceptor.java:65)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
| org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
| org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
| org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
| org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
| org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
| org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
| org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:70)
| org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:131)
| org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
| org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
| org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:380)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
|
Probably this can be fixed with a line or two, but being a newcomer, I have no idea where to look.
And above this, is there an easy way to change to whole portal data management datasource to my datasource, or do I have to find and fill the above mentioned lines into each hibernate config file?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133455#4133455
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133455
16 years, 10 months
[EJB/JBoss] - EJB error when invoked by a jsp ........ please help
by sajhak
Hi all ,
i developed an EJB named Converter , which is a currency converter , and used by a jsp page.when the submit button of the page is clicked the application gives the following exception ....
please anybody can tell me what could be the cause for this .. ??
23:07:05,406 INFO [STDOUT] Couldn't create converter bean.converter.ejb.Converter not bound
23:07:07,218 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.index_jsp._jspService(index_jsp.java:98)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:619)
Thanks in advance
Sajith
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133453#4133453
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133453
16 years, 10 months
[JBoss/Spring Integration] - Re: JBOSS5 + Spring Deployer version confusion
by alesj
"dlmiles" wrote :
| Anyway now moving onto my next problem.
|
| Are all the schemes that spring usually has setup (when running as a web-app in plain Tomcat; not Tomcat under JBoss), are they enabled and functional with respect to JBoss ? In particular the scheme handler for "classpath:" I have a:
|
| <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
| | <property name="location">
| | <value>classpath:config/application.properties</value>
| | </property>
| | </bean>
|
| But I'm getting the error:
|
| DEBUG [org.jboss.deployers.vfs.deployer.kernel.BeanDeployer] Parsed file: JarEntryHandler(a)28894583[path=Service.ear/Foobar.war/WEB-INF/spring-beans.xml context=file:/data/opt/jboss-5.0.0.Beta4/server/default/deploy/ real=jar:file:/data/opt/jboss-5.0.0.Beta4/server/default/tmp/javatmp/nestedjar19733.tmp!/WEB-INF/spring-beans.xml] to: classpath:/config/application.properties
| |
| | DEBUG [org.jboss.deployers.vfs.deployer.kernel.BeanDeployer] Error during deploy: vfsfile:/data/opt/jboss-5.0.0.Beta4/server/default/deploy/Service.ear/Foobar.war
| | org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/data/opt/jboss-5.0.0.Beta4/server/default/deploy/Service.ear/Foobar.war
| | at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
| |
| | ....SNIP....
| |
| | Caused by: java.lang.ClassCastException
| | at java.lang.Class.cast(Class.java:2951)
| | at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:136)
|
Ah, yes, I though this one will come up sooner or later. :-)
This has nothing to do with Spring.
It's the way we deploy our Microcontainer beans.
BeanDeployer picks up any file that ends with -beans.xml, assuming that this is where MC beans are declared.
You can either rename the file or change the way BeanDeployer handles this file, e.g. perhaps not using the file if it also contains 'spring' in its name.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133451#4133451
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133451
16 years, 10 months
[JBoss/Spring Integration] - Re: JBOSS5 + Spring Deployer version confusion
by dlmiles
"dlmiles" wrote : Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to parse schema for nsURI=, baseURI=null, schemaLocation=http://www.springframework.org/dtd/spring-beans.dtd
I converted all my spring-beans.dtd to XSD (both in the web-app itself and all its included JARs from WEB-INF/lib, what a pain!). My guess on the problem here is that the XML parser is configured by JBoss (as it owns the XML parser and its configuration and supplies it to the JBoss Spring Deployer / Spring Framework). So I am thinking that either the JBoss Spring Deployer should supply a DTD resolver to the JBoss XML Parser that can locate the DTD from within the spring-beans.jar when necessary or Spring Framework is making presumptions about how the XML parser is already configured before it uses it.
Anyway now moving onto my next problem.
Are all the schemes that spring usually has setup (when running as a web-app in plain Tomcat; not Tomcat under JBoss), are they enabled and functional with respect to JBoss ? In particular the scheme handler for "classpath:" I have a:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
| <property name="location">
| <value>classpath:config/application.properties</value>
| </property>
| </bean>
But I'm getting the error:
DEBUG [org.jboss.deployers.vfs.deployer.kernel.BeanDeployer] Parsed file: JarEntryHandler(a)28894583[path=Service.ear/Foobar.war/WEB-INF/spring-beans.xml context=file:/data/opt/jboss-5.0.0.Beta4/server/default/deploy/ real=jar:file:/data/opt/jboss-5.0.0.Beta4/server/default/tmp/javatmp/nestedjar19733.tmp!/WEB-INF/spring-beans.xml] to: classpath:/config/application.properties
|
| DEBUG [org.jboss.deployers.vfs.deployer.kernel.BeanDeployer] Error during deploy: vfsfile:/data/opt/jboss-5.0.0.Beta4/server/default/deploy/Service.ear/Foobar.war
| org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/data/opt/jboss-5.0.0.Beta4/server/default/deploy/Service.ear/Foobar.war
| at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
|
| ....SNIP....
|
| Caused by: java.lang.ClassCastException
| at java.lang.Class.cast(Class.java:2951)
| at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:136)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133450#4133450
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133450
16 years, 10 months
[JBoss Portal] - Problem about new column of table 'jbp_user'
by gumreal
Hi all,
Using portal 2.6.2, I want to add new column to table 'jbp_users' and make the new column accessed from 'profile.xhtml'.
First modified the jboss-identity 1.0.0 as follow,
domain.hbm.xml
| <property
| name="unit"
| column="col_unit"
| type="java.lang.String"
| update="true"
| insert="true"
| unique="false"/>
|
User.java
| public String getUnit();
| public void setUnit(String unit);
|
HibernateUserImpl.java
| protected String unit;
| public String getUnit() {return unit;}
| public void setUnit(String unit) {this.unit = unit;}
|
Then built new portal-identity-lib.jar for JBoss Portal.
In JBoss Portal Source, modified 3 files follow the chapter 'Reference Guide - 16.3.3. Example 3: adding new properties'.
profile-config.xml
| <property>
| <name>user.unit</name>
| <type>java.lang.String</type>
| <access-mode>read-write</access-mode>
| <usage>mandatory</usage>
| <display-name xml:lang="en">Unit</display-name>
| <description xml:lang="en">User's Unit</description>
| <mapping>
| <database>
| <type>column</type>
| <value>col_unit</value>
| </database>
| </mapping>
| </property>
|
identity-ui-configuration.xml
| <ui-component name="unit">
| <property-ref>user.unit</property-ref>
| <required>true</required>
| </ui-component>
|
profile.xhtml
| <h:panelGroup>
| <h:outputText value="unit"/>
| <h:outputText value=" *" rendered="#metadataservice.unit.required}" />
| </h:panelGroup>
| <h:inputText id="unit" value="#{manager.uiUser.attribute.unit}" required="#{metadataservice.unit.required}"/>
| <h:panelGroup />
|
Finally, deploy the jboss portal.
However, what I input in the profile page for the column 'unit' has been saved to table 'jbp_user_prop' with the key 'user.unit', remainning 'NULL' in column 'col_unit' of table 'jbp_user'.
How to solve this problem?
Thanks for any help:)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133449#4133449
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133449
16 years, 10 months