[EJB 3.0] - Re: JNDI Entry for EJB3 Session Bean in JBossAS 5.0.0Beta2 n
by martinLuene
Here is the console output when deploying UserManagement3Component,
there is no exception, but two warnings, i don't understand:
09:46:46,375 INFO [MCKernelAbstraction] installing bean: persistence.units:jar=um3.jar,unitName=UserManagement3Component with dependencies:
09:46:51,578 INFO [MCKernelAbstraction] jboss.jca:name=jcoffee/jdbc/datasources/jcoffee_db_tx,service=DataSourceBinding
09:46:51,765 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:jar=um3.jar,unitName=UserManagement3Component
09:46:52,156 INFO [Version] Hibernate EntityManager 3.2.0.GA
09:46:53,140 INFO [Version] Hibernate Annotations 3.2.0.GA
09:46:53,171 INFO [Environment] Hibernate 3.2.1
09:46:53,203 INFO [Environment] hibernate.properties not found
09:46:53,203 INFO [Environment] Bytecode provider name : javassist
09:46:53,234 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
09:46:53,921 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.AddressEntity
09:46:53,953 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.EmailAddressEntity
09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.FailedLogonHistoryEntity
09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PasswordEntity
09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PasswordHistoryEntity
09:46:53,968 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PasswordNotAllowedEntity
09:46:53,984 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.PersonEntity
09:46:54,000 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.TelephoneNoEntity
09:46:54,015 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.UserEntity
09:46:54,015 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.UserGroupEntity
09:46:54,031 INFO [Ejb3Configuration] found EJB3 Entity bean: com.jcoffee.components.um3.UserUserGroupsUserGroupUsersRelation
09:46:54,031 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
09:46:54,859 INFO [Configuration] Reading mappings from resource : META-INF/orm.xml
09:46:54,875 INFO [Ejb3Configuration] [PersistenceUnit: UserManagement3Component] no META-INF/orm.xml found
09:46:55,218 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.AddressEntity
09:46:55,500 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.AddressEntity on table ADDRESS
09:46:55,781 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.EmailAddressEntity
09:46:55,781 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.EmailAddressEntity on table EMAILADDRESS
09:46:55,796 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.FailedLogonHistoryEntity
09:46:55,796 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.FailedLogonHistoryEntity on table FAILEDLOGONHISTORY
09:46:55,796 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PasswordEntity
09:46:55,796 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PasswordEntity on table PASSWORD
09:46:55,812 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PasswordHistoryEntity
09:46:55,812 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PasswordHistoryEntity on table PASSWORDHISTORY
09:46:55,843 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PasswordNotAllowedEntity
09:46:55,843 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PasswordNotAllowedEntity on table PASSWORDSNOTALLOWED
09:46:55,843 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.PersonEntity
09:46:55,843 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.PersonEntity on table PERSON
09:46:55,843 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.TelephoneNoEntity
09:46:55,843 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.TelephoneNoEntity on table TELEPHONENO
09:46:55,859 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.UserEntity
09:46:55,859 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.UserEntity on table USERS
09:46:55,953 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.UserGroupEntity
09:46:55,953 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.UserGroupEntity on table USERGROUP
09:46:56,109 INFO [AnnotationBinder] Binding entity from annotated class: com.jcoffee.components.um3.UserUserGroupsUserGroupUsersRelation
09:46:56,109 INFO [EntityBinder] Bind entity com.jcoffee.components.um3.UserUserGroupsUserGroupUsersRelation on table USERGROUPUSER
09:46:58,640 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
09:46:58,656 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
09:46:58,656 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the OLAP and Data Mining options
09:46:58,656 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.1.0.2.0
09:46:58,796 INFO [Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
09:46:59,062 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
09:46:59,078 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
09:46:59,093 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
09:46:59,093 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
09:46:59,093 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
09:46:59,093 INFO [SettingsFactory] JDBC batch size: 15
09:46:59,093 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
09:46:59,109 INFO [SettingsFactory] Scrollable result sets: enabled
09:46:59,109 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
09:46:59,109 INFO [SettingsFactory] Connection release mode: auto
09:46:59,109 INFO [SettingsFactory] Default batch fetch size: 1
09:46:59,109 INFO [SettingsFactory] Generate SQL with comments: disabled
09:46:59,109 INFO [SettingsFactory] Order SQL updates by primary key: disabled
09:46:59,109 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
09:46:59,125 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
09:46:59,125 INFO [SettingsFactory] Query language substitutions: {}
09:46:59,125 INFO [SettingsFactory] JPA-QL strict compliance: enabled
09:46:59,125 INFO [SettingsFactory] Second-level cache: enabled
09:46:59,125 INFO [SettingsFactory] Query cache: disabled
09:46:59,125 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
09:46:59,140 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
09:46:59,140 INFO [SettingsFactory] Structured second-level cache entries: disabled
09:46:59,187 INFO [SettingsFactory] Statistics: disabled
09:46:59,187 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
09:46:59,187 INFO [SettingsFactory] Default entity-mode: pojo
09:46:59,484 INFO [SessionFactoryImpl] building session factory
09:47:01,437 INFO [SessionFactoryObjectFactory] Factory name: persistence.units:jar=um3.jar,unitName=UserManagement3Component
09:47:01,437 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFact
ory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
09:47:01,625 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.units:jar=um3.jar,unitName=UserManagement3Component
09:47:01,625 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
09:47:01,625 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFact
ory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
09:47:02,328 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=um3.jar,name=UserManagement3Component,service=EJB3 with dependencies:
09:47:02,328 INFO [MCKernelAbstraction] persistence.units:jar=um3.jar,unitName=UserManagement3Component
09:47:10,453 INFO [EJBContainer] STARTED EJB: com.jcoffee.components.um3.UserManagement3Component ejbName: UserManagement3Component
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049209#4049209
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049209
18 years, 11 months
[JBoss jBPM] - Re: Signal a task on a html form submit
by cahimoped
Ok I post you some code and informations... It will not say more that I already said... but ok let's go.
Here is my task :
<task-node name="Creer bilan">
| <task name="bilanCP">
| <assignment actor-id="#{CP}" />
| </task>
| <transition to="Evaluation DP" name="OK"></transition>
| </task-node>
|
Here is my association in the forms.xml :
<form task="bilanCP" form="bilanCP.xhtml"/>
Here is my bilanCP.xhtml (displaying well) :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:c="http://java.sun.com/jstl/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:tf="http://jbpm.org/jsf/tf"
| xmlns:jbpm="http://jbpm.org/jsf">
|
| <ui:component>
| <form enctype="multipart/form-data" method="POST" action="uploadSuivi">
| <jbpm:dataform>
| <f:facet name="header">
| Envoyer un fichier local
| </f:facet>
| <jbpm:datacell>
| <f:facet name="header">
| Selectionnez le fichier a envoyer :
| </f:facet>
| <input class="file" type="file" name="suiviXLS"/>
| <input name="nomProjet" type="hidden" value="#{var['nomProjet']}"/>
| <input name="tokenId" type="hidden" value="#{token.getId}"/>
| </jbpm:datacell>
|
| <jbpm:datacell>
| <f:facet name="header">
| <h:outputText value="Actions"/>
| </f:facet>
| <button class="button" type="submit">Envoyer</button>
| </jbpm:datacell>
|
| </jbpm:dataform>
| </form>
|
| <br />
|
| <jbpm:dataform>
| <f:facet name="header">
| <h:outputText value="Fichier distant modifie"/>
| </f:facet>
|
| <jbpm:datacell>
| <f:facet name="header">
| <h:outputText value="Actions"/>
| </f:facet>
| <!-- TASKFORM BUTTONS -->
| <tf:transitionButton transition="OK" value="Faire suivre le fichier au DP"/>
| </jbpm:datacell>
| </jbpm:dataform>
|
| </ui:component>
|
| </html>
|
and here is my servlet :
import java.io.File;
| import java.io.IOException;
| import java.io.PrintWriter;
| import java.util.Iterator;
| import java.util.List;
|
| import javax.servlet.http.HttpServlet;
| import javax.servlet.http.HttpServletRequest;
| import javax.servlet.http.HttpServletResponse;
|
| import org.apache.commons.fileupload.FileItem;
| import org.apache.commons.fileupload.FileItemFactory;
| import org.apache.commons.fileupload.servlet.ServletFileUpload;
| import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
| public class UploadSuivi extends HttpServlet {
|
| private static final long serialVersionUID = -7214369336993351418L;
|
| private FileItem fichier;
| private String nomProjet;
| private String tokenId;
|
| public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
| if (!ServletFileUpload.isMultipartContent(request)) {
| throw new RuntimeException("Not a multipart request");
| }
|
| try {
| // Create a factory for disk-based file items
| FileItemFactory factory = new DiskFileItemFactory();
|
| // Create a new file upload handler
| ServletFileUpload upload = new ServletFileUpload(factory);
|
| // Parse the request
| List list = upload.parseRequest(request);
|
| // Process the uploaded items
|
| for (int i=0; i<list.size(); i++) {
| FileItem item = (FileItem) list.get(i);
|
| if (item.getFieldName().compareTo("suiviXLS") == 0) {
| fichier = item;
| }
|
| if (item.getFieldName().compareTo("nomProjet") == 0) {
| nomProjet=item.getString();
| }
|
| if (item.getFieldName().compareTo("tokenId") == 0) {
| tokenId=item.getString();
| }
| }
|
| // save the file
| File uploadedFile = new File("C:/"+nomProjet+".xls");
| fichier.write(uploadedFile);
|
| // signal the task
|
| // redirtection vers la page des taches
| response.sendRedirect(response.encodeRedirectURL("search/tasks.jsf"));
| } catch (Exception e) {
| throw new RuntimeException("Exception quelque part...", e);
| }
| }
| }
|
The code is ugly, I know, it's because it's not finished at all...
At the end of the execution I got my file, my project name variable in nomProjet and an empty string in tokenId (so it goes in the if statement and does the getString on the third item).
I understand that my token.getId should work from this part of documentation (section 18.3, I can copy paste it: it's really short) and the link given to EL:
For some of the delegations, there is support for a JSP/JSF EL like expression language. In actions, assignments and decision conditions, you can write an expression like e.g. expression="#{myVar.handler[assignments].assign}"
|
| The basics of this expression language can be found in the J2EE tutorial.
|
| The jPDL expression language is similar to the JSF expression language. Meaning that jPDL EL is based on JSP EL, but it uses #{...} notation and that it includes support for method binding.
|
| Depending on the context, the process variables or task instance variables can be used as starting variables along with the following implicit objects:
|
| * taskInstance (org.jbpm.taskmgmt.exe.TaskInstance)
| * processInstance (org.jbpm.graph.exe.ProcessInstance)
| * processDefinition (org.jbpm.graph.def.ProcessDefinition)
| * token (org.jbpm.graph.exe.Token)
| * taskMgmtInstance (org.jbpm.taskmgmt.exe.TaskMgmtInstance)
| * contextInstance (org.jbpm.context.exe.ContextInstance)
I'm not an expert in all the JSF and EL and even if I didn't find anything to help me looking these parts.
I'm using the jBPM 3.2 suite (sorry I forgot to mention that) and GPD 3.0.13 to deploy and have the process definition and forms skeleton (I write a lot by myself after... I'm waiting the new GPD (seems great) to leave the alpha and beta states before using it :) ).
If you want to know everything :
- I customize the example web application to fit my needs by removing some administration parts, adding servlets and others things I need,
- I begin to use the new admin console from CVS (I think I will somehow merge the two at the end),
- my shoes size is 10 and... ok I stop here :)
Hope it helps...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049208#4049208
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049208
18 years, 11 months
[JBoss jBPM] - ClassCastException: org.jbpm.msg.jms.JmsMessageServiceFactor
by Wash
Hi guys,
We are currently trying to deploy a process into jBPM 3.2 GA over WebLogic 9.2 SA and we are encountering the following exception. The process definition (processdefinition.xml) is a simple node with an async state. We can't find this class JmsMessageServiceFactoryImpl.
Any ideas ?
Thanks,
Wash
Failed to start process: org.jbpm.msg.jms.JmsMessageServiceFactoryImpl
| java.lang.ClassCastException: org.jbpm.msg.jms.JmsMessageServiceFactoryImpl
| at org.jbpm.svc.Services.getServiceFactory(Services.java:122)
| at org.jbpm.svc.Services.getService(Services.java:139)
| at org.jbpm.svc.Services.getCurrentService(Services.java:88)
| at org.jbpm.svc.Services.getCurrentService(Services.java:81)
| at org.jbpm.graph.def.Node.enter(Node.java:314)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
|
|
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$da1614b7.enter(<generated>)
| at org.jbpm.graph.def.Transition.take(Transition.java:151)
| at org.jbpm.graph.def.Node.leave(Node.java:393)
| at org.jbpm.graph.node.StartState.leave(StartState.java:70)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
|
|
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$da1614b7.leave(<generated>)
| at org.jbpm.graph.exe.Token.signal(Token.java:194)
| at org.jbpm.graph.exe.Token.signal(Token.java:165)
| at org.jbpm.webapp.bean.ProcessBean.startInstance(ProcessBean.java:162)
| at org.jbpm.webapp.bean.ProcessBean$StartInstanceListener.processAction(ProcessBean.java:123
|
| )
| at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
| at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
| at javax.faces.component.UICommand.broadcast(UICommand.java:368)
| at javax.faces.component.UIData.broadcast(UIData.java:854)
| at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.
|
| java:223)
| at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
| at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
| at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
| at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
| at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
| at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
| at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
| at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
| at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
|
| ontext.java:3243)
| at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
| at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
| at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2
|
| 003)
| at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
| at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
| at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
| at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)>
| org.jbpm.JbpmException: setRollbackOnly was invoked while configuration specifies user managed trans
|
| actions
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:203)
| at org.jbpm.svc.Services.close(Services.java:222)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.webapp.bean.JbpmBean.closeJbpmContext(JbpmBean.java:35)
| at org.jbpm.webapp.listener.JbpmPhaseListener.afterPhase(JbpmPhaseListener.java:113)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:278)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.
|
| java:223)
| at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
| at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
| at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
| at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
| at org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:59)
| at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
| at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
| at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
| at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
|
| ontext.java:3243)
| at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
| at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
| at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2
|
| 003)
| at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
| at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
| at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
| at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049206#4049206
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049206
18 years, 11 months
[JBoss Portal] - Re: portal help urgent
by rharari
Hi Shailesh,
You can harcode a link to "/portal/yourpage" or walk into the portal hierarchy to find your pages.
Follows an example how to do that:
| import org.jboss.portal.api.node.PortalNode;
| import org.jboss.portal.api.node.PortalNodeURL;
| import org.jboss.portlet.JBossRenderRequest;
| import org.jboss.portlet.JBossRenderResponse;
| import org.jboss.portal.core.impl.api.node.PortalNodeImpl;
|
| ....
|
| protected void doView(RenderRequest request, RenderResponse response) throws PortletException, UnavailableException {
| ....
|
| String myPageName = "MyPageName"; // this is your page name that you´re looking for
| JBossRenderRequest req = (JBossRenderRequest) request;
| PortalNode currentNode = req.getPortalNode();
| while (currentNode.getType() != PortalNode.TYPE_PORTAL) {
| currentNode = currentNode.getParent();
| }
| for (Iterator i = currentNode.getChildren().iterator(); i.hasNext();) {
| PortalNode child = (PortalNode)i.next();
| if (child.getType() == PortalNode.TYPE_PAGE) {
| if (child instanceof PortalNodeImpl) {
| if (child.getName().equals(myPageName)) {
| PortalNodeURL childURL = ((JBossRenderResponse)response).createRenderURL(child);
| System.out.println("url to mypage = " + childURL.toString());
| break;
| }
| }
| }
| }
|
|
There is a good example with the source code.
Check out this portlet:
core\src\main\org\jboss\portal\core\portlet\catalog\CatalogPortlet.java
You can also verify if the user is allowed to access it before redirect.
Hope this help.
regards,
R.Harari
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049203#4049203
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049203
18 years, 11 months