[Microcontainer] - Re: Conflict between ejb3 deployer and custom GenericAnnotat
by gregory.mostizky@gmail.com
I was able to do a workaround solution after stepping through all the deployment code yesterday. It works now but I would appreciate your comments on whether I did it right and also for the benefit of whoever gets stuck with it in the future.
I added the following to the QmfTypeAnnotationDeployer class:
| public QmfTypeAnnotationDeployer() {
| log.info("Initalizing "+this.getClass().getSimpleName());
| addInput(JBossMetaData.class);
| setOutputs(new HashSet<String>());
| setOutput(QmfRegisteredClassesMetaData.class);
| }
|
What this does is it makes sure that my custom annotation deployer runs after all normal EJB3 annotation scanners. The way I understand it is that the problem was that by default GenericAnnotationDeployer sets its output as AnnotationEnviroment and this creates a conflict between it and some other deployer from EJB3 package which also outputs AnnotationEnviroment but slightly changed. Since the previous version of my custom deployer didnt have any inputs it was running first and basically giving wrong AnnotationEnviroment to the rest of EJB3 deployers - which (after some more processing) would generate the exception I have experienced.
If my understanding is correct the fix should be easy - just change the output of EJB3 deployer to something like setOutput('internal.'+AnnotationEnviroment.class.getSimpleName()) which will make sure that both AnnotationEnviroments can co-exist happily :)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228547#4228547
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228547
16 years, 11 months
[EJB 3.0] - Authorization failure when accessing a data source from EJB
by japase
Hi,
As suggested in http://www.jboss.org/index.html?module=bb&op=viewtopic&t=153488&postdays=... I continue here with the data source authorization problem.
In a superclass to our generated EJBs we're injecting two data sources as followed:
| /**
| * Base class for all EJB classes.
| */
| @DeclareRoles({FndConstants.USER_ROLE, FndConstants.TRUSTED_MODULE_ROLE})
| @RolesAllowed({FndConstants.USER_ROLE})
| abstract class FndAbstractBean {
|
| @Resource(name="fndbas_en-US", mappedName="java:jdbc/fndbas_en-US")
| private DataSource dsEn;
|
| @Resource(name="fndbas-noxa_en-US", mappedName="java:jdbc/fndbas-noxa_en-US")
| private DataSource dsNoXaEn;
|
| public DataSource getDataSource(String name) throws SystemException {
| if("fndbas_en-US".equals(name))
| return dsEn;
| else if("fndbas-noxa_en-US".equals(name))
| return dsNoXaEn;
| throw new SystemException("No dependency to DataSource " + name);
| }
|
| // rest of the class code...
| }
|
All EJBs are generated with the same jboss.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
| <jboss>
| <security-domain>java:/jaas/IFSApplications</security-domain>
| </jboss>
|
Corresponding section in login-config.xml:
| <!-- IFS Applications security domain -->
| <application-policy name="IFSApplications">
| <authentication>
| <login-module code="ifs.fnd.sf.j2ee.security.jboss.FndOracleLoginModule" flag="requisite">
| <module-option name="debug">true</module-option>
| <module-option name="jdbcUrl">jdbc:oracle:thin:@gbgrnd23:1521:app75sp3</module-option>
| <module-option name="driverClassName">oracle.jdbc.OracleDriver</module-option>
| <module-option name="dbAppowner">IFSAPP</module-option>
| <module-option name="systemUsersOnly">false</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
Data sources deployments:
1) oracle-ds.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>jdbc/fndbas-noxa_en-US</jndi-name>
| <connection-url>jdbc:oracle:thin:@gbgrnd23:1521:app75sp3</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>ifssys</user-name>
| <password>password here...</password>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| </local-tx-datasource>
| </datasources>
|
2) oracle-xa-ds.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <datasources>
|
| <xa-datasource>
| <jndi-name>jdbc/fndbas_en-US</jndi-name>
| <track-connection-by-tx>true</track-connection-by-tx>
| <isSameRM-override-value>false</isSameRM-override-value>
| <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
| <xa-datasource-property name="URL">jdbc:oracle:thin:@gbgrnd23:1521:app75sp3</xa-datasource-property>
| <xa-datasource-property name="User">ifssys</xa-datasource-property>
| <xa-datasource-property name="Password">password here...</xa-datasource-property>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>50</max-pool-size>
| <idle-timeout-minutes>10</idle-timeout-minutes>
| <prepared-statement-cache-size>100</prepared-statement-cache-size>
| <application-managed-security>true</application-managed-security>
| <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| <no-tx-separate-pools/>
| </xa-datasource>
|
| <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
| name="jboss.jca:service=OracleXAExceptionFormatter">
| <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
| </mbean>
|
| </datasources>
|
When trying to access a data source I get the following error stack in the console window:
anonymous wrote :
| 10:21:55,818 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
| java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
| at org.jboss.security.auth.spi.Util.loadProperties(Util.java:198)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
| at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
| at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
| at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
| at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:552)
| at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:486)
| at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)
| at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)
| at org.jboss.security.integration.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:90)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:687)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:495)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
| at ifs.fnd.sf.j2ee.FndJ2eeConnectionManager.getConnection(FndJ2eeConnectionManager.java:77)
| at ifs.fnd.sf.storage.FndConnectionManager.getPlsqlConnectionImpl(FndConnectionManager.java:341)
| at ifs.fnd.sf.storage.FndConnectionManager.getPlsqlConnection(FndConnectionManager.java:379)
| at ifs.fnd.sf.storage.FndConnectionManager.getConnection(FndConnectionManager.java:211)
| at ifs.fnd.sf.storage.FndSqlStorage$Context.getConnection(FndSqlStorage.java:589)
| at ifs.fnd.sf.storage.FndSqlStorage.query(FndSqlStorage.java:3011)
| at ifs.fnd.sf.storage.FndEntityHandler.query(FndEntityHandler.java:216)
| at ifs.application.applicationsupport.impl.StandardEntityHandlerImpl.queryEntity(StandardEntityHandlerImpl.java:100)
| at ifs.application.applicationsupport.impl.StandardEntityHandlerBean.query(StandardEntityHandlerBean.java:164)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
| at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
| at ifs.fnd.sf.j2ee.FndAbstractBean.aroundInvoke(FndAbstractBean.java:136)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.ejb3.interceptors.aop.BusinessMethodBeanMethodInterceptor.invoke(BusinessMethodBeanMethodInterceptor.java:71)
| at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:59)
| at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
| at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
| at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_19401861.invoke(InvocationContextInterceptor
| _z_fillMethod_19401861.java)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
| at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_19401861.invoke(InvocationContextInterceptor_z_se
| tup_19401861.java)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
| at org.jboss.aspects.tx.TxInterceptor$Supports.invoke(TxInterceptor.java:143)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:154)
| at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
| at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
| at $Proxy144.query(Unknown Source)
| at ifs.fnd.sf.storage.FndEntityHandler.query(FndEntityHandler.java:216)
| at ifs.application.isocountry.ISOCountryHandlerImplBase.query(ISOCountryHandlerImplBase.java:83)
| at ifs.application.isocountry.ISOCountryHandlerWrapper.query(ISOCountryHandlerWrapper.java:117)
| at ifs.application.manageisocountry.impl.BrowseISOCountryImpl.queryISOCountry(BrowseISOCountryImpl.java:38)
| at ifs.application.manageisocountry.BrowseISOCountryWrapper.queryISOCountry(BrowseISOCountryWrapper.java:54)
| at ifs.application.manageisocountry.BrowseISOCountryBean.queryISOCountry(BrowseISOCountryBean.java:92)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
| at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
| at ifs.fnd.sf.j2ee.FndAbstractBean.aroundInvoke(FndAbstractBean.java:136)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.ejb3.interceptors.aop.BusinessMethodBeanMethodInterceptor.invoke(BusinessMethodBeanMethodInterceptor.java:71)
| at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:59)
| at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
| at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
| at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_19401861.invoke(InvocationContextInterceptor
| _z_fillMethod_19401861.java)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
| at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_19401861.invoke(InvocationContextInterceptor_z_se
| tup_19401861.java)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
| at org.jboss.aspects.tx.TxInterceptor$Supports.invoke(TxInterceptor.java:143)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
| at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:154)
| at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
| at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
| at $Proxy1099.queryISOCountry(Unknown Source)
| at com.ifsworld.webservices.manageisocountry.browseisocountry.BrowseISOCountry.queryISOCountry(BrowseISOCountry.java:80)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE.invoke(InvocationHandlerJSE.java:108)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:222)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:474)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
| at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
| at org.jboss.web.tomcat.security.BasicAuthValve.invoke(BasicAuthValve.java:75)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
| at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
|
Method FndJ2eeConnectionManager.getConnection() - line 77 is the one where we call ds.getConnection():
| protected FndConnection getConnection(String dataSource, String username, String password) throws IfsException {
| FndJ2eeContext ctx = FndJ2eeContext.getCurrentJ2eeContext();
| DataSource ds = ctx.getCurrentBean().getDataSource(dataSource);
| try {
| Connection c = username == null ? ds.getConnection() : ds.getConnection(username, password);
| return new FndConnection(c);
| }
| catch (SQLException e) {
| throw new SystemException(e, Texts.GETDBCONN, dataSource, e.getMessage());
| }
| }
|
The same application with the same oracle-*.xml data sources deployments and the same definition in login-config.xml works in JBoss 4.3.
The error stack above comes from version 5.1.0.CR1, but I've also tested with 5.1.0.Beta1 with the same result.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228530#4228530
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228530
16 years, 11 months
[JBossWS] - Obscure 'SAXParseException: Content is not allowed in prolog
by angusm
I have a 'Content is not allowed in prolog' problem. But I am pretty sure that it is not any of the usual culprits (spaces or invalid characters where they should not be).
I have a WSDL (below). This is for a document type WS, and the schema is at http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1... .
I have verified that the WSDL is WSI Basic Profile 1.1 with soapUI and the WS-I Testing Tools V1.1.
It is correctly parsed and treated by wsconsume.
The server application is correctly deployed. But when I try to run the client I get (full stack trace below)
WSDLException (at /definitions/types/xs:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.orgsoap/envelope/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog. It seems to get stuck parsing the soap envelope schema, which is imported into the 3GPP schema. (I have validated the 3GPP schema with http://www.w3.org/2001/03/webdata/xsv).
JBossWS : version.id=3.0.1-native-2.0.4.GA.
As ever, any suggestions ideas infinitely appreciated.
WSDL:
(I changed the WSDL soap NS to soapx as I thought there might be conficts with the 3GPP NS soap, but it did not make any difference)
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name="MM7Service" targetNamespace="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:tns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapx="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
| <types>
| <xs:schema targetNamespace="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:tns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" elementFormDefault="qualified" attributeFormDefault="unqualified">
| <xs:include schemaLocation="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1..."/>
| </xs:schema>
| </types>
| <message name="MM7_SubmitReq">
| <part name="SubmitReq" element="tns:SubmitReq">
| </part>
| </message>
| <message name="MM7_SubmitRsp">
| <part name="SubmitReq" element="tns:SubmitRsp">
| </part>
| </message>
| <portType name="MM7">
| <operation name="submit">
| <input message="tns:MM7_SubmitReq">
| </input>
| <output message="tns:MM7_SubmitRsp">
| </output>
| </operation>
| </portType>
| <binding name="MM7Binding" type="tns:MM7">
| <soapx:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="submit">
| <soapx:operation soapAction=""/>
| <input>
| <soapx:body use="literal"/>
| </input>
| <output>
| <soapx:body use="literal"/>
| </output>
| </operation>
| </binding>
| <service name="MM7Service">
| <port name="MM7Port" binding="tns:MM7Binding">
| <soapx:address location="REPLACE_WITH_ACTUAL_URL"/>
| </port>
| </service>
| </definitions>
|
Stack Trace:
09:44:35,338 TRACE [JBossEntityResolver] Mapped systemId to filename:
| 09:44:35,338 TRACE [JBossEntityResolver] maps to URL: file:/C:/Other/eclipseall/ws/hsi/mm7-client2/bin/
| [Fatal Error] :1:1: Content is not allowed in prolog.
| Exception in thread "main" org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xs:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.org/soap/envelope/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:152)
| at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:293)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:84)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:136)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63)
| at javax.xml.ws.Service.<init>(Service.java:79)
| at org._3gpp.ftp.specs.archive._23_series._23_140.schema.rel_6_mm7_1_4.MM7Service.<init>(MM7Service.java:41)
| at test.client.MM7ClientTest2.main(MM7ClientTest2.java:25)
| Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xs:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.org/soap/envelope/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.getDocument(JBossWSDLReaderImpl.java:2136)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:832)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:866)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:656)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseTypes(JBossWSDLReaderImpl.java:617)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseDefinitions(JBossWSDLReaderImpl.java:329)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2290)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2254)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2307)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2328)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2360)
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:125)
| ... 7 more
| Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
| at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
| at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.getDocument(JBossWSDLReaderImpl.java:2126)
| ... 18 more
Client program:
private final static String WSDL_HTTP = "http://frpar-morisona1:8080/mm7/MM7Bean?wsdl";
|
| private final static String NAMESPACE = "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4";
|
|
| public static void main(String[] args) throws Exception {
|
| MM7Service serv = new MM7Service(new URL(WSDL_HTTP), new QName(NAMESPACE, "MM7Service"));
|
| MM7 port = serv.getMM7Port();
|
| SubmitReqType submitReq = new SubmitReqType();
|
| SubmitRspType submitRsp = port.submit(submitReq);
| }
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228529#4228529
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228529
16 years, 11 months