[Design the new POJO MicroContainer] - Re: Plague of temp VFS files and OOM on redeploy
by scott.stark@jboss.org
"alesj" wrote :
| (3) I only got this via user feedback, hence not really tested
| And like the users says, the real cause might be elsewhere.
| But Marko promised to have a look anyway. :-)
|
| The user also notes that this wasn't an issue in previous JBossAS versions.
| But after starting small internal discussion I'm no longer persuaded that that's really true,
| as I didn't get any (internal) feedback that would point me to some real proof that we actually did things any different,
| different from File.deleteOnExit or deleting temp at boot time.
| It might be just the simplicity of what we did before that resulted in things working.
|
| Looks like that what might work for users, doesn't quite work for us yet
| - simplicity vs. VFS's API. But we'll get there. ;-)
The old MainDeployer has an explicit delete of existing content in the tmp directory when it was updated, so the question is how is the redeploy being done?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201521#4201521
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201521
17 years, 2 months
[Design of JBoss Portal] - Per window customization even when it is not dashboard
by vivek_saini07
I have enabled drag-and-drop property for portal. Now I want to persist the portlet-window location in database when window is dragged from one region and dropped in another region/order. So that when page gets refreshed (or user log in again) he finds the portlet-window at the location it was dragged by him(or by any other user) last time.
Overall I want same functionality as it is provided in dashboard. The reason I can not use dashboard here is dashboard is user specific. In my scenario it should be portalID (even when portalID is not in dashboard context) specific, means any user can change the location of portlet-window,and other users should see this.
till now i have reached to following lines in CustomizationManagerService
| if (user != null)
| {
| String userId = getUserId(user);
|
| // And if it is in a dashboard context we get the per window customization
| if (isDashboard(window, user))
| {
| // That's how we manufacture dash board keys
| String dashboardId = window.getId().toString();
|
| //
| instance = instance.getCustomization(dashboardId);
| }
| else
| {
| instance = instance.getCustomization(userId);
| }
|
|
what i want is per window customization even when it is not dashboard. Is there any way?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201499#4201499
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201499
17 years, 2 months
[Design of EJB 3.0] - JBoss 5.0.0.GA: jboss.entity.manager.factory.jndi.name w/ su
by matt10
I'm upgrading an enterprise app from JBoss 4.2.1.GA to JBoss 5.0.0.GA and have hit a snag.
In persistence.xml, the property jboss.entity.manager.factory.jndi.name should allow binding EntityManagerFactory instances into JNDI. From what I've read, this does work in the GA release.
I bind EMFs into a subcontext though, i.e. a directory in JNDI, in order to enumerate them programatically. i.e.:
| persistence-units/
| +- PU1: InjectedEntityManagerFactory
| +- PU2: InjectedEntityManagerFactory ...
|
This used to work, but doesn't seem to work in 5.0.0.GA.
Exception:
| 2009-01-13 17:30:35,482 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=Application.ear/MyApp.jar#PU1$
| javax.naming.NameNotFoundException: persistence-units not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
| at org.jnp.server.NamingServer.rebind(NamingServer.java:244)
| at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:562)
| at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:527)
| at javax.naming.InitialContext.rebind(InitialContext.java:408)
| at org.jboss.util.naming.NonSerializableFactory.rebind(NonSerializableFactory.java:185)
| at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:325)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
Here I think is the relevant code in PersistenceUnitDeployment.java:
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jpa/trunk/dep...
| String entityManagerFactoryJndiName = (String) props.get("jboss.entity.manager.factory.jndi.name");
| if (entityManagerFactoryJndiName != null)
| {
| EntityManagerFactory injectedFactory = new InjectedEntityManagerFactory(managedFactory);
| NonSerializableFactory.rebind(initialContext, entityManagerFactoryJndiName, injectedFactory);
| }
|
NonSerializableFactory.rebind() looks like this:
http://docs.huihoo.com/javadoc/jboss/4.0.2/org/jboss/naming/NonSerializab...
| /** A convience method that simplifies the process of rebinding a
| non-serializable object into a JNDI context.
|
| @param ctx, the JNDI context to rebind to.
| @param key, the key to use in both the NonSerializableFactory map and JNDI. It
| must be a valid name for use in ctx.bind().
| @param target, the non-Serializable object to bind.
| @throws NamingException, thrown on failure to rebind key into ctx.
| */
| public static synchronized void rebind(Context ctx, String key, Object target) throws NamingException
| {
| NonSerializableFactory.rebind(key, target);
| // Bind a reference to target using NonSerializableFactory as the ObjectFactory
| String className = target.getClass().getName();
| String factory = NonSerializableFactory.class.getName();
| StringRefAddr addr = new StringRefAddr("nns", key);
| Reference memoryRef = new Reference(className, addr, factory, null);
| ctx.rebind(key, memoryRef);
| }
|
The NonSerializableFactory.rebind() method signature used by PersistenceUnitDeployment won't create subcontexts as needed.
There is another method available which looks like it would solve my problem if used instead with a createSubcontexts argument of true:
| /** A convience method that simplifies the process of rebinding a
| non-zerializable object into a JNDI context. This version binds the
| target object into the default IntitialContext using name path.
|
| @param name, the name to use as JNDI path name. The key into the
| NonSerializableFactory map is obtained from the toString() value of name.
| The name parameter cannot be a 0 length name.
| @param target, the non-Serializable object to bind.
| @param createSubcontexts, a flag indicating if subcontexts of name should
| be created if they do not already exist.
| @throws NamingException, thrown on failure to rebind key into ctx.
| */
| public static synchronized void rebind(Name name, Object target,
| boolean createSubcontexts) throws NamingException
| {
| String key = name.toString();
| InitialContext ctx = new InitialContext();
| if( createSubcontexts == true && name.size() > 1 )
| {
| int size = name.size() - 1;
| Util.createSubcontext(ctx, name.getPrefix(size));
| }
| rebind(ctx, key, target);
| }
|
This post is related to another forum post but seems to be a distinct use case. Here's the related post:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=142385
If I have identified the issue correctly; Is JBoss intended to still support the creation of subcontexts in JNDI? Could this change be made for compatibility with 4.2.x.GA?
An alternative solution for me could be to be able to create this JNDI context "persistence-units" before the Persistence Units are deployed, but where would I do this?
If a JBoss Developer or Expert can comment on this one I'd appreciate it.
Regards,
Matt[/url]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201476#4201476
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201476
17 years, 2 months