[JBoss Portal] - PortalObjectPermission always returns true...
by indyJones
JBoss Server 4.0.5 GA
MySQL
JBoss Portal 2.4
My Custom Portlet is trying to determine if an object should be available to a user. Currently, it is always returning true...
In my jboss-portal.xml
|
| <portlet>
| <portlet-name>MyPortlet</portlet-name>
| <transaction>
| <trans-attribute>Required</trans-attribute>
| </transaction>
| </portlet>
|
| <service>
| <service-name>PortalObjectContainer</service-name> <service-class>org.jboss.portal.core.model.portal.PortalObjectContainer</service-class>
| <service-ref>:container=PortalObject</service-ref>
| </service>
| <service>
| <service-name>InstanceContainer</service-name>
| <service-class>org.jboss.portal.core.model.instance.InstanceContainer</service-class>
| <service-ref>:container=Instance</service-ref>
| </service>
| <service>
| <service-name>ThemeService</service-name>
| <service-class>org.jboss.portal.theme.ThemeService</service-class>
| <service-ref>:service=ThemeService</service-ref>
| </service>
| <service>
| <service-name>LayoutService</service-name>
| <service-class>org.jboss.portal.theme.LayoutService</service-class>
| <service-ref>:service=LayoutService</service-ref>
| </service>
| <service>
| <service-name>CMS</service-name>
| <service-class>org.jboss.portal.cms.CMS</service-class>
| <service-ref>:service=CMS</service-ref>
| </service>
| <service>
| <service-name>UserModule</service-name>
| <service-class>org.jboss.portal.identity.UserModule</service-class>
| <service-ref>:service=Module,type=User</service-ref>
| </service>
| <service>
| <service-name>RoleModule</service-name>
| <service-class>org.jboss.portal.identity.RoleModule</service-class>
| <service-ref>:service=Module,type=Role</service-ref>
| </service>
| <service>
| <service-name>MailModule</service-name>
| <service-class>org.jboss.portal.core.modules.MailModule</service-class>
| <service-ref>:service=Module,type=Mail</service-ref>
| </service>
| <service>
| <service-name>PortalAuthorizationManagerFactory</service-name>
| <service-class>org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory</service-class>
| <service-ref>:service=PortalAuthorizationManagerFactory</service-ref>
| </service>
| <service>
| <service-name>AuthorizationDomainRegistry</service-name>
| <service-class>org.jboss.portal.security.AuthorizationDomainRegistry</service-class>
| <service-ref>:service=AuthorizationDomainRegistry</service-ref>
| </service>
| <service>
| <service-name>FederatingPortletInvoker</service-name>
| <service-class>org.jboss.portal.federation.FederatingPortletInvoker</service-class>
| <service-ref>:service=PortletInvoker,type=Federating</service-ref>
| </service>
|
Inside my portlet I have the following...
|
| portalAuthorizationManagerFactory = (PortalAuthorizationManagerFactory)getPortletContext().getAttribute("PortalAuthorizationManagerFactory");
|
|
| PortalObjectPermission perm = new PortalObjectPermission(node.getRef(), PortalObjectPermission.VIEW_MASK);
| return portalAuthorizationManagerFactory.getManager().checkPermission(perm);
|
|
I think I am missing the JTA connection but I dont really understand how to do it...
Can someone please help...
Thanks
Indy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017217#4017217
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017217
19Â years, 2Â months
[JBoss Messaging] - ClassLoader issue with user classes and JBM 1.0.1SP4
by jcasp
Hello,
I'm having some trouble migrating to JBoss Messaging 1.0.1SP4 from JBossMQ. I'm running JBossAS 4.0.5GA.
The problem is when onMessage() is called in a JMS client in an ear. I get a "java.lang.ClassNotFoundException: No ClassLoaders found for: <my class>". That class is located in a jar within the ear.
I can instantiate the class elsewhere without a problem, so it's not a missing jar issue. When the class is deserialized from the JMS ObjectMessage.getObject() method, the above-mentioned exception occurs:
| public void onMessage(Message message) {
| try {
| ObjectMessage objectMessage = (ObjectMessage) message;
| DNSAMessage dnsaMessage = (DNSAMessage) objectMessage.getObject();
| ...
|
I've read through the scoped classloader wiki docs, and even tried setting the ear to use the same loader-repository as jboss-messaging as suggested in other threads. Predictably, if I copy the jar containing my userland class into jboss-messaging.sar, the class is found but a ClassCastException is thrown, because two separate classloaders are now trying to use the same classes.
I'm guessing since onMessage is called by a JBM thread, it uses JBM's classloader, hence the problem. How should I configure JBM so that it doesn't try to load my userland classes?
Thank you for any ideas and help.
Justin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017215#4017215
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017215
19Â years, 2Â months
[JBoss Seam] - Getting the helloworld example working in Tomcat
by apushadow
Has anyone been able to successfully get the remoting/helloworld example working in Tomcat? I deploy it via "ant clean deploy.tomcat" and the helloworld app comes up, but I get this in my popup window when I type in my name:
| Thu Feb 15 2007 14:34:03 GMT-0600 (Central Standard Time): Request packet:
| <envelope><header><context></context></header><body><call component="helloAction" method="sayHello" id="0">
| <params><param><str>apushadow</str></param></params><refs></refs></call></body></envelope>
|
|
| Thu Feb 15 2007 14:34:04 GMT-0600 (Central Standard Time): Response packet:
|
The stacktrace in the Tomcat log says:
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: helloAction
| at org.jboss.seam.Component.newInstance(Component.java:1766)
| at org.jboss.seam.Component.getInstance(Component.java:1669)
| at org.jboss.seam.Component.getInstance(Component.java:1636)
| at org.jboss.seam.remoting.Call.execute(Call.java:115)
| at org.jboss.seam.remoting.ExecutionHandler.handle(ExecutionHandler.java:87)
| at org.jboss.seam.remoting.SeamRemotingServlet.doPost(SeamRemotingServlet.java:78)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Unknown Source)
| Caused by: javax.naming.NamingException: Local server is not initialized
| at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
| at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
| at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
| at javax.naming.InitialContext.init(Unknown Source)
| at javax.naming.InitialContext.<init>(Unknown Source)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1071)
| at org.jboss.seam.Component.instantiate(Component.java:1057)
| at org.jboss.seam.Component.newInstance(Component.java:1762)
| ... 21 more
|
I looked in my [tomcat root]/webapps/seam-helloworld/WEB-INF/lib directory and verified that jboss-ejb3-all.jar is there. I haven't touched the components.xml or any other config file from what comes with the downloaded Seam 1.1.6 example code, and I went through Chapter 18 on Remoting in the Seam reference guide, and it seems like the helloworld example should work. I've also cleared any other webapps out of both the Tomcat/webapps and Tomcat/work directories, and I always make sure I do an "ant clean deploy.tomcat".
Any direction would be greatly appreciated. Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017211#4017211
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017211
19Â years, 2Â months
[JBoss Seam] - Tip worthy of inclusion in the documentation...
by tony.herstellï¼ gmail.com
Can this be added to the doco.. it's a great tip.
perhaps close to pg 67
anonymous wrote :
| The declaration lets you specify a value or method binding expression that will be evaluated to initialize
| the value of a context variable when it is first referenced.
|
|
|
|
anonymous wrote :
|
| I also use the following in components.xml
|
| |
| | <factory name="basePath"
| | value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName}:
| | #{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath
| | }/"/>
| |
|
|
|
| Note this is all one line the forum wrapped
|
| and
|
|
| |
| | <base href="#{basePath}" />
| |
| |
|
| So i can have the view files in different directories, but still resolve the images and css to the root of the webapp with out having to do ../../images/myimage.jpg
|
| I used to use something like this
|
|
| |
| | @Create
| | public void setup() {
| | request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
| | }
| |
| |
| | @Factory("basePath")
| | public void loadBasePath()
| | {
| | basePath = request.getScheme() + "://" +
| | request.getServerName() + ":" +
| | request.getServerPort() + request.getContextPath() + "/";
| | }
| |
| |
|
|
| _________________
| Thank you for your time,
|
| Jason Long
| CEO and Chief Software Engineer
| BS Physics, MS Chemical Engineering
| http://www.supernovasoftware.com
| HJBUG Founder and President
| http://www.hjbug.com
|
|
led to me re-organising my code a lot:
| <link rel="stylesheet" type="text/css" ref="#{basePath}/xmlhttp/css/xp/xp.css" />
| <link rel="stylesheet" type="text/css" href="#{basePath}/css/risingstars.css" />
|
Allowing me to move a lot of pages that users should not access under WEB-INF
| template="/WEB-INF/pages/template.xhtml">
|
Perhaps it obvious to you lot, but saved me a whole heap of headache.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017207#4017207
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017207
19Â years, 2Â months