[EJB 3.0] - Re: query.getResultList(); <= contains the same instance X t
by jblackmore
Do you have any collections on that entity? Are you using EJBQL with joins? I think I stumbled over a related scenario, except I'm calling 'getSingleResult' and getting an exception that there are 6 or 8 or 124 elements. No code or queries or even data changed since 4.0.4 in my case, and this just started happening after moving to 4.0.5.
I think the problem is that there may be only one instance of TABLE1 but 10 of some mapped OneToMany collection of your entity. I used a SortedSet instead of the default List (generated by Hibernate tools) to eliminate dups in 4.0.4, but that approach doesn't seem to do the trick any more. The other thing you can do is wrap the result list with a LinkedHashSet, to eliminate dups and preserve the order. It occurs to me that this is all part of the "paradigm mismatch", but I feel like I shouldn't have to do that, Hibernate should. But it works.
Please see this post for my "fix" that got me from 4.0.2 to 4.0.4, but now I have to go back into every EJBQL query invoked throughout the system and wrap it with a LinkedHashSet. Sigh, job security. :-)
/index.html?module=bb&op=viewtopic&t=82946&start=10
Anyone know a better solution?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986322#3986322
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986322
19Â years, 7Â months
[JBoss Portal] - Failed to create instance of Portlet.
by mohamed.rafi
Hi,
I am trying to install a new portlet into the JBoss Portal. However, when I try to deploy it, I get the following error:
| 14:05:48,123 WARN [PortletAppDeployment] Failed to create instance TestRafiPortletInstance of portlet /testrafiportlet.TestRafiPortlet because portlet /testrafiportlet.TestRafiPortlet is not available
| 14:05:48,372 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
|
Following are the descriptor files and their contents which I have used.
portlet-instances.xml
| <deployments>
| <deployment>
|
| <instance>
| <instance-id>TestRafiPortletInstance</instance-id>
| <portlet-ref>TestRafiPortlet</portlet-ref>
| </instance>
| </deployment>
| </deployments>
|
|
portlet.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| version="1.0">
| <portlet>
| <portlet-name>TestRafiPortlet</portlet-name>
| <portlet-class>com.apple.TestRafiPortlet</portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>Test Rafi Portlet</title>
| </portlet-info>
| </portlet>
| </portlet-app>
|
|
testrafi-object.xml
| <deployments>
| <deployment>
| <if-exists>overwrite</if-exists>
| <parent-ref>default.default</parent-ref>
| <window>
| <window-name>TestRafiPortletWindow</window-name>
| <instance-ref>TestRafiPortletInstance</instance-ref>
| <region>center</region>
| <height>1</height>
| </window>
| </deployment>
| </deployments>
|
The exception which is getting thrown is:
| 14:05:47,307 INFO [TomcatDeployer] deploy, ctxPath=/testrafiportlet, warUrl=.../deploy/testrafiportlet.war/
| 14:05:48,024 ERROR [AbstractKernelController] Error installing to Start: name=portal:container=Portlet,id=/testrafiportlet.TestRafiPortlet state=Create
| org.jboss.portal.portlet.container.PortletInitializationException: The portlet TestRafiPortlet threw a runtime exception during init
| at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:287)
| ...
| ...
| 14:05:48,123 WARN [PortletAppDeployment] Failed to create instance TestRafiPortletInstance of portlet /testrafiportlet.TestRafiPortlet because portlet /testrafiportlet.TestRafiPortlet is not available
| 14:05:48,372 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
|
|
Any ideas on what am I missing here, and how to get it fixed?
Regards
Rafi SM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986321#3986321
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986321
19Â years, 7Â months