[JBoss JIRA] (WFLY-1727) Allow injection of resources from external JNDI contexts
by Jan Martiska (JIRA)
[ https://issues.jboss.org/browse/WFLY-1727?page=com.atlassian.jira.plugin.... ]
Jan Martiska commented on WFLY-1727:
------------------------------------
I think there is still some misunderstanding between us about the functionality..
Your enhanced test now injects the external contexts, like this:
{noformat}
@Resource(lookup = "java:global/ldap")
private InitialDirContext ldap;
{noformat}
this surely works, no doubt. But I meant injecting *resources* from inside the external contexts.
You can use the "ldap" variable as obtained in the code above to do lookups like
{noformat}
LdapCtx c = (LdapCtx)ldap.lookup("dc=jboss,dc=org");
{noformat}
and obtain objects (LdapCtx in this example) from the external context. But currently, you have to do this in two steps - as I did in these two examples. First, you inject (with @Resource) the external context, then you perform a lookup programatically.
What I meant is a possibility to be able to obtain the LdapCtx in just one step, one @Resource injection, something like ...
{noformat}
@Resource(lookup = "java:global/ldap#dc=jboss,dc=org")
private LdapCtx c;
{noformat}
(not sure about the possible exact syntax for it, but it could look similarly)
Which would automatically perform a lookup inside the InitialDirContext, which is stored under java:global/ldap.
Would that be possible?
> Allow injection of resources from external JNDI contexts
> --------------------------------------------------------
>
> Key: WFLY-1727
> URL: https://issues.jboss.org/browse/WFLY-1727
> Project: WildFly
> Issue Type: Feature Request
> Components: Naming
> Reporter: Jan Martiska
> Assignee: Eduardo Martins
>
> The ability to federate external JNDI contexts into WildFly's JNDI namespaces was introduced with WFLY-287.
> Currently, it is not possible to programatically inject resources into applications (eg. using @Resource annotation) from the federated contexts. It would be a nice to have feature.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (WFLY-1406) Hibernate cannot process package-info.java any more
by Juergen Zimmermann (JIRA)
[ https://issues.jboss.org/browse/WFLY-1406?page=com.atlassian.jira.plugin.... ]
Juergen Zimmermann commented on WFLY-1406:
------------------------------------------
Scott, could you set a breakpoint in org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildDeploymentResources() line 279? This class is contained in "Hibernate EntityManager".
{code}
for ( PackageDescriptor packageDescriptor : scanResult.getLocatedPackages() ) {
packageDescriptorMap.put( packageDescriptor.getName(), packageDescriptor ); // line 279
}
{code}
When I inspect the variable "packageDescriptor" and look for the value of the attribute "name" then the package name has "/". Do you also see "/" or "." in the "name" attribute on your Fedora machine?
BTW, scanResult is set at line 219:
{code}
final ScanResult scanResult = scan( bootstrapServiceRegistry );
{code}
However, when I try to traverse the scanResult object, I cannot see anything useful, since there are no toString() methods.
> Hibernate cannot process package-info.java any more
> ---------------------------------------------------
>
> Key: WFLY-1406
> URL: https://issues.jboss.org/browse/WFLY-1406
> Project: WildFly
> Issue Type: Feature Request
> Components: JPA / Hibernate
> Affects Versions: 8.0.0.Alpha2
> Reporter: Juergen Zimmermann
> Attachments: javap.log, server.log, server.log.zip, shop2.war, tar.log
>
>
> I tried the snapshot which contains Hibernate 4.3.0.Beta2. However, package-info.java files are causing problems. For instance, the package de.shop.artikelverwaltung.domain has a package-info.java which causes a NoClassDefFoundError:
> "IllegalName: de/shop/artikelverwaltung/domain.package-info". Please see the stacktrace below.
> Here is an example for package-info.java which was working with WildFly 8.0.0.Alpha1:
> @XmlAccessorType(FIELD)
> @Vetoed
> package de.shop.artikelverwaltung.domain;
> import static javax.xml.bind.annotation.XmlAccessType.FIELD;
> import javax.enterprise.inject.Vetoed;
> import javax.xml.bind.annotation.XmlAccessorType;
> The stacktrace:
> ...
> 09:29:53,880 WARN [org.jboss.modules] Failed to define class de/shop/artikelverwaltung/domain.package-info in Module "deployment.shop2.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link de/shop/artikelverwaltung/domain/package-info (Module "deployment.shop2.war:main" from Service Module Loader)
> at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.Module.loadModuleClass(Module.java:526) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final]
> at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:218) [hibernate-core-4.3.0.Beta2.jar:4.3.0.Beta2]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:423) [rt.jar:1.7.0_21]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356) [rt.jar:1.7.0_21]
> at org.hibernate.annotations.common.util.ReflectHelper.classForName(ReflectHelper.java:160) [hibernate-commons-annotations-4.0.2.Final.jar:4.0.2.Final]
> at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.packageForName(JavaReflectionManager.java:121) [hibernate-commons-annotations-4.0.2.Final.jar:4.0.2.Final]
> at org.hibernate.cfg.AnnotationBinder.bindPackage(AnnotationBinder.java:262) [hibernate-core-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.cfg.Configuration.addPackage(Configuration.java:792) [hibernate-core-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildHibernateConfiguration(EntityManagerFactoryBuilderImpl.java:1174) [hibernate-entitymanager-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:839) [hibernate-entitymanager-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:836) [hibernate-entitymanager-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:368) [hibernate-core-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:835) [hibernate-entitymanager-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:142) [hibernate-entitymanager-4.3.0.Beta2.jar:4.3.0.Beta2]
> at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:213) [wildfly-jpa-8.0.0.Alpha2-SNAPSHOT.jar:8.0.0.Alpha2-SNAPSHOT]
> at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$800(PersistenceUnitServiceImpl.java:58) [wildfly-jpa-8.0.0.Alpha2-SNAPSHOT.jar:8.0.0.Alpha2-SNAPSHOT]
> at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:107) [wildfly-jpa-8.0.0.Alpha2-SNAPSHOT.jar:8.0.0.Alpha2-SNAPSHOT]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
> at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
> at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final.jar:2.1.0.Final]
> Caused by: java.lang.NoClassDefFoundError: IllegalName: de/shop/artikelverwaltung/domain.package-info
> at java.lang.ClassLoader.preDefineClass(ClassLoader.java:646) [rt.jar:1.7.0_21]
> at java.lang.ClassLoader.defineClass(ClassLoader.java:785) [rt.jar:1.7.0_21]
> at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) [jboss-modules.jar:1.2.0.Final]
> at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) [jboss-modules.jar:1.2.0.Final]
> ... 28 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (WFLY-1460) WildFly server fails to start with transactions configured to be run with JDBCObject store
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/WFLY-1460?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on WFLY-1460:
-----------------------------------------------
Ivo Studensky <istudens(a)redhat.com> made a comment on [bug 971360|https://bugzilla.redhat.com/show_bug.cgi?id=971360]
> WildFly server fails to start with transactions configured to be run with JDBCObject store
> ------------------------------------------------------------------------------------------
>
> Key: WFLY-1460
> URL: https://issues.jboss.org/browse/WFLY-1460
> Project: WildFly
> Issue Type: Bug
> Components: Transactions
> Affects Versions: 8.0.0.Alpha1
> Reporter: Ondřej Chaloupka
> Assignee: Stefano Maestri
>
> In case that you configure transactions subsystem for running with JDBCObject store the app server fails to start because of (it seems so) a circular dependency.
> You can expect the exception like:
> {code}
> ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 52) JBAS014612: Operation ("add") failed - address: ([("subsystem" => "transactions")]): org.jboss.msc.service.CircularDependencyException: Container jboss-as has a circular dependency: [service jboss.txn.ArjunaObjectStoreEnvironment, service jboss.txn.ArjunaRecoveryManager, service jboss.connector.transactionintegration, service jboss.cached-connection-manager, service jboss.data-source.java:jboss/datasources/JDBCObjectDS]
> {code}
> My assumption came from the configuration similar to this:
> {code}
> <datasource jta="false" jndi-name="java:jboss/datasources/JDBCObjectDS" pool-name="JDBCObjectDS" enabled="true" use-ccm="false">
> <connection-url>jdbc:postgresql://postgresserver.com:5432/user1</connection-url>
> <driver-class>org.postgresql.Driver</driver-class>
> <driver>postgresql-9.2-1002.jdbc4.jar</driver>
> <security>
> <user-name>user1</user-name>
> <password>user1</password>
> </security>
> </datasource>
> {code}
> and the transaction config looks like this
> {code}
> <jdbc-store datasource-jndi-name="java:jboss/datasources/JDBCObjectDS" />
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (WFLY-1460) WildFly server fails to start with transactions configured to be run with JDBCObject store
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/WFLY-1460?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on WFLY-1460:
-----------------------------------------------
Ivo Studensky <istudens(a)redhat.com> changed the Status of [bug 971360|https://bugzilla.redhat.com/show_bug.cgi?id=971360] from NEW to CLOSED
> WildFly server fails to start with transactions configured to be run with JDBCObject store
> ------------------------------------------------------------------------------------------
>
> Key: WFLY-1460
> URL: https://issues.jboss.org/browse/WFLY-1460
> Project: WildFly
> Issue Type: Bug
> Components: Transactions
> Affects Versions: 8.0.0.Alpha1
> Reporter: Ondřej Chaloupka
> Assignee: Stefano Maestri
>
> In case that you configure transactions subsystem for running with JDBCObject store the app server fails to start because of (it seems so) a circular dependency.
> You can expect the exception like:
> {code}
> ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 52) JBAS014612: Operation ("add") failed - address: ([("subsystem" => "transactions")]): org.jboss.msc.service.CircularDependencyException: Container jboss-as has a circular dependency: [service jboss.txn.ArjunaObjectStoreEnvironment, service jboss.txn.ArjunaRecoveryManager, service jboss.connector.transactionintegration, service jboss.cached-connection-manager, service jboss.data-source.java:jboss/datasources/JDBCObjectDS]
> {code}
> My assumption came from the configuration similar to this:
> {code}
> <datasource jta="false" jndi-name="java:jboss/datasources/JDBCObjectDS" pool-name="JDBCObjectDS" enabled="true" use-ccm="false">
> <connection-url>jdbc:postgresql://postgresserver.com:5432/user1</connection-url>
> <driver-class>org.postgresql.Driver</driver-class>
> <driver>postgresql-9.2-1002.jdbc4.jar</driver>
> <security>
> <user-name>user1</user-name>
> <password>user1</password>
> </security>
> </datasource>
> {code}
> and the transaction config looks like this
> {code}
> <jdbc-store datasource-jndi-name="java:jboss/datasources/JDBCObjectDS" />
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months