[JBoss Portal] - Re: Packaging of portlet-instances.xml
by MNLipp
OK, now that I have been directed to instantiating the "foreign" portlet programatically, I've tried.
I'm doing things from a servlet's init method. Now please do not tell me to use an MBean. It doesn't fit in my environment, and it should be possible to do it from a servlet's init method, right? I execute a JavaScript and I have successfully created my instance and added the "Unchecked"/"view" permission (you didn't mention this, but without it I get an access denied error when trying to display the portlet instance). Seemed easy enough:
| function createPortletInstance (containerService, instanceId, portletId, prefs) {
| if (containerService.getInstance (instanceId) != null) {
| containerService.destroyInstance (instanceId);
| }
| var portletInstance = containerService.createInstance (instanceId, portletId);
| if (prefs != null) {
| portletInstance.setPreferences (prefs);
| }
| var authDomain = containerService.getAuthorizationDomain();
| var configurator = authDomain.getConfigurator();
| var bindings = new Packages.java.util.HashSet ();
| var binding = new Packages.org.jboss.portal.security.RoleSecurityBinding
| ("view", Packages.org.jboss.portal.security.SecurityConstants.UNCHECKED_ROLE_NAME);
| bindings.add (binding);
| configurator.setBindings (instanceId, bindings);
| }
|
Now, when executing this I get the following messages:
| 23:44:23,105 WARN [ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.jboss.portal.core.impl.portlet.state.PersistentState.children#38
| 23:44:23,105 WARN [ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.jboss.portal.core.impl.portlet.state.PersistentState#38
| 23:44:23,105 WARN [ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.jboss.portal.core.impl.portlet.state.PersistentState.children#40
|
The warnings are somehow disturbing. Are they a problem? Can I avoid them?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014698#4014698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014698
19Â years, 2Â months
[JNDI/Naming/Network] - Re: NameNotFoundException: xxxx not bound
by rzuidema
Found the problem, mostly pilot error, from the EJB Tutorial:
anonymous wrote :
| JNDI Bindings
| By default, session beans will bind to JNDI in the form ejbName/remote for remote interfaces and ejbName/local in the case of local interfaces. When the EJBs are deployed in an .ear file, the default jndi binding will be prepended by the name of the .ear file. So if the ear file name is foo.ear the default jndi names would be foo/EJB-NAME/remote and foo/EJB-NAME/local. You can override this behavior by defining your own @org.jboss.ejb3.LocalBinding or @org.jboss.ejb3.remoting.RemoteBinding.
|
Note the EJB name
When I used the ear name it worked:
| try {
| Properties p = new Properties();
| Context c = new InitialContext();
| return (FirstcategoryFacadeLocal) c.lookup("NewsApp/FirstcategoryFacade/local");
| }
|
|
Thanks anyway
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4014683#4014683
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4014683
19Â years, 2Â months