[JBoss Seam] - When to use @PersistenceContext vrs @In EntityManager (SMPC)
by reind
I've been experiencing some problems since switching to seam 2 with anonymous wrote : org.hibernate.LazyInitializationException: could not initialize proxy - no Session
Is my understanding correct:
One should use a SMPC in Seam components that are *not* session beans.
@In EntityManager entityManager
For stateful session beans (that may or may not be seam components) one should use:
@PersistenceContext(type=EXTENDED)
EntityManager entityManager
For stateless session beans (that may or may not be seam components) one should use:
@PersistenceContext
EntityManager entityManager
The problem I'm experiencing is that I have a SFSB using an entityManager annotated with @PersistenceContext(type=EXTENDED). Some operations on entities produce the LazyInitializationException. If I switch to a Conversation Scoped Seam component, and start a long running conversation, then these exceptions go away.
This class is just meant to be a SFSB (Session Scope) though, not Conversation scoped. Am I wrong in thinking that the PersistenceContext(type=EXTENDED) should stay around as long as the bean is alive, and thus not produce LIEs?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127190#4127190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127190
18 years, 2 months
[JBoss Messaging] - Re: Message priority does not seem to work
by ydzsidemiik
I have done as you suggested and written a pure JMS test case, which reproduces the same behavior.
http://www.mediafire.com/?ec6wfg9cg1b
It is a simple J2SE application, with a main() method. It connects to JBoss Messaging from outside the container.
During my testing, I was surprised to find that priorities set on JMS message objects (javax.jms.Message.setJMSPriority(int)) seem to be getting ignored. The "high priority" messages come out of the queue with their priority set to 4, which would explain why they are not being treated preferentially.
Priorities set on MessageProducers seem to have an effect though; the priority takes and the message reflects its higher priority (via javax.jms.Message.getJMSPriority()) when it comes out of the queue. Even here however, I noted delays of up to 10 seconds in this particular test in handling these high priority messages. It seems reasonable to expect that for a consumer capable of handling 15 messages per second, one high priority message every five seconds could be handled almost instantly, but I am not a messaging middleware expert and may be missing something fundamental. Please correct me if so.
If you run the example, run it first as is to see how priorities set on messages are ignored. Then, uncomment the lines marked with "XXX:" in Main.java to see how setting priorities on the MessageProducer level improves things.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127185#4127185
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127185
18 years, 2 months
[JBoss Seam] - Problems to Run SeamTest with SQLServer
by tienwang11
I am trying to run the SeamTest with my application which is on WindowsXP, JDK 160 update 2, and Seam 2.0, JBoss 4.2.2., SqlServer 2005. I was able run get my environment running.
I had a weird problems:
I can run my app from the browser. I can also run a very simple testNG SeamTest (without using entitymanager) to the default Hsqldb. But if I switched to my data source to SQLServer:
I got the below error:
jboss.messaging:service=PostOffice -> com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'CLUSTERED'.
| at org.jboss.embedded.Bootstrap.checkIncomplete(Bootstrap.java:144)
|
When I turned the trace on, I see
exec sp_cursorprepexec @p1 output,@p2 output,N'@P0 nvarchar(4000)',N'SELECT NODE_ID, QUEUE_NAME, CONDITION, SELECTOR, CHANNEL_ID, CLUSTERED FROM JBM_POSTOFFICE WHERE
| POSTOFFICE_NAME = @P0 ',4112,8193,@p7 output,N'JMS'
| select @p1, @p2, @p7
This seems related to "Clustered" is a reserved word for SQLServer 2005.
I found a similar issue logged for SEAM 1.2
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026019#4026019
I wonder if there is any workaround? Any help will be greatly appreciated.
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127182#4127182
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127182
18 years, 2 months
[Security & JAAS/JBoss] - JAAS security conversion from WebSphere to JBoss
by plscstx
Team --
I am trying to convert an application using JAAS on WebSphere to be using JAAS on JBoss.
I feel like I am still missing some things, not to mention that I keep typing in my correct password and it is not authenticating.
I am not using an EJBs just base web authentication.
jboss-web.xml =
<?xml version="1.0"?>
<jboss-web>
<!-- All secured web content uses this security manager -->
<security-domain>java:/jaas/mortgageAdmin</security-domain>
</jboss-web>
login-config.xml =
<application-policy name = "mortgageAdmin">
<login-module code = "org.jboss.security.auth.spi.LdapLoginModule" flag = "required">
<module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
<module-option name="java.naming.provider.url">ldap://~~~~~</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="java.naming.security.principal">"drhi\\"+username</module-option>
<module-option name="java.naming.security.credentials">password</module-option>
</login-module>
</application-policy>
Where I feel like I am still missing something is the fact that in WebSphere, we had to define an ibm-application-bnd.xmi file which looks like the below snippet. However, I am not sure where I would be putting this equivalent for the JBoss configuration.
<?xml version="1.0" encoding="UTF-8"?>
<applicationbnd:ApplicationBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applicationbnd="applicationbnd.xmi" xmi:id="ApplicationBinding_1103565947194">
<authorizationTable xmi:id="AuthorizationTable_1103565947194">
<authorizations xmi:id="RoleAssignment_1108662566127">
<groups xmi:id="Group_1159457809140" name="App.Prod.Mortgage.~~~.LoanOfficer"/>
<groups xmi:id="Group_1159457809141" name="App.Prod.Mortgage.~~~.LoanOfficer"/>
<groups xmi:id="Group_1159457809142" name="App.Prod.Mortgage.~~~.LoanOfficer"/>
...
Also, I am currently getting the following error and I know I am typing in my password correctly.
The server log is reporting the following:
2008-02-06 15:11:58,537 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(mortgageAdmin), authInfo=AppConfigurationEntry[]:
[0]
LoginModule Class: org.jboss.security.auth.spi.LdapLoginModule
ControlFlag: LoginModuleControlFlag: required
Options:name=uidAttributeID, value=username
name=java.naming.security.authentication, value=simple
name=java.naming.factory.initial, value=com.sun.jndi.ldap.LdapCtxFactory
name=java.naming.security.credentials, value=password
name=java.naming.provider.url, value=ldap://ad7.drhorton.com:389
name=java.naming.security.principal, value=username
name=principalDNPrefix, value="drhi\\"
2008-02-06 15:11:58,537 DEBUG [org.apache.catalina.loader.WebappClassLoader] loadClass(org.jboss.security.auth.spi.LdapLoginModule, false)
2008-02-06 15:11:58,537 DEBUG [org.apache.catalina.loader.WebappClassLoader] Searching local repositories
2008-02-06 15:11:58,537 DEBUG [org.apache.catalina.loader.WebappClassLoader] findClass(org.jboss.security.auth.spi.LdapLoginModule)
2008-02-06 15:11:58,537 DEBUG [org.apache.catalina.loader.WebappClassLoader] Delegating to parent classloader at end: java.net.FactoryURLClassLoader@260657
2008-02-06 15:11:58,553 DEBUG [org.apache.catalina.loader.WebappClassLoader] Loading class from parent
2008-02-06 15:11:58,553 TRACE [org.jboss.security.auth.spi.LdapLoginModule] initialize, instance=@26134959
2008-02-06 15:11:58,553 TRACE [org.jboss.security.auth.spi.LdapLoginModule] Security domain: mortgageAdmin
2008-02-06 15:11:58,553 TRACE [org.jboss.security.auth.spi.LdapLoginModule] login
2008-02-06 15:11:58,553 TRACE [org.jboss.security.auth.spi.LdapLoginModule] Logging into LDAP server, env={java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, java.naming.provider.url=ldap://ad7.drhorton.com:389, jboss.security.security_domain=mortgageAdmin, uidAttributeID=username, principalDNPrefix="drhi\\", java.naming.security.authentication=simple, java.naming.security.principal="drhi\\"pcable, java.naming.security.credentials=***}
2008-02-06 15:11:58,553 DEBUG [org.apache.catalina.loader.WebappClassLoader] loadClass(com.sun.jndi.ldap.LdapCtxFactory, false)
2008-02-06 15:11:58,584 DEBUG [org.jboss.security.auth.spi.LdapLoginModule] Bad password for username=pcable
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525
Any ideas?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127180#4127180
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127180
18 years, 2 months
[JBoss Tools (users)] - Hibernate Query tool in JBoss Tools
by gjeudy
Hi,
I cannot use Hibernate Query in JBoss Tools. I get an error with cannot connect to datasource when I try to execute a query.
I suspect this has something to do with JNDI service not available or datasource not setup. Can someone point me where I can setup this data source in eclipse IDE plugin ?
Thanks,
-Guillaume
See below:
eclipse.buildId=M20071023-1652
| java.version=1.6.0_03
| java.vendor=Sun Microsystems Inc.
| BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
| Command-line arguments: -os win32 -ws win32 -arch x86 -data C:\gjeudy\workspace
|
| Error
| Wed Feb 06 15:38:20 EST 2008
| javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
|
| javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
| at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
| at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
| at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
| at javax.naming.InitialContext.lookup(Unknown Source)
| at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
| at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
| at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)
| at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
| at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
| at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
| at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:357)
| at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
| at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
| at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:352)
| at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:97)
| at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:103)
| at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
| at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4127175#4127175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4127175
18 years, 2 months