开发者

jboss 4.2.3 application connecting IBM Filenet

开发者 https://www.devze.com 2023-03-17 08:47 出处:网络
I developed a simple demo web application using JSF2.0 and hibernate. This webapp use IBM FileNet 4.5.1 to store and retrieve the uploaded files.

I developed a simple demo web application using JSF2.0 and hibernate. This webapp use IBM FileNet 4.5.1 to store and retrieve the uploaded files. If I deploy this webapp on JBoss 6.0, everything works fine. But a customer ask me to deploy it on a JBoss 4.2.3 for evaluating... and it doesn't work. When I try to access IBM Filenet I receive an error... here's the stack trace:

17:32:47,353 INFO  [STDOUT] 17:32:47,353 DEBUG JaasConfiguration:60 - Default JAAS Configuration: 
HttpCredentials {
    com.idoox.security.jaas.HttpLoginModule required;
}

FileNetP8Engine {
    com.filenet.api.authentication.jboss.login.FnClientLoginModule required;
}

FCLMStackingHelper {
    org.jboss.security.ClientLoginModule required;
}

NameMapping {
    com.idoox.security.jaas.NameLoginModuleNoAuth required;
}

Credentials {
    com.idoox.security.jaas.GSSLoginModule required;
}

KrbCredentials {
    com.sun.security.auth.module.Krb5LoginModule required;
}

NamePasswordAN {
    com.idoox.security.jaas.NamePasswordLoginModule required;
}

CertsMapping {
    com.idoox.security.jaas.CertsLoginModule required;
}

CachedKrbCredentials {
    com.sun.security.auth.module.Krb5LoginModule required;
}

NamePasswordNoAN {
    com.idoox.security.jaas.NamePasswordLoginModuleNoAuth required;
}

FileNetP8WSI {
    com.filenet.api.util.WSILoginModule required;
}

FileNetP8 {
    com.filenet.api.authentication.jboss.login.FnClientLoginModule required;
}

ReceivedCredentials {
    com.idoox.security.jaas.GSSLoginModuleNoAuth required;
}

FileNetP8Server {
    com.filenet.api.authentication.jboss.login.FnClientLoginModule required;
}

HttpRequest {
    com.idoox.security.jaas.SmLoginModule required;
}

FileNetP8KerberosService {
    com.filenet.api.authentication.jboss.login.FnClientLoginModule required;
}

NameDigestAN {
    com.idoox.security.jaas.NameDigestLoginModule required;
}

17:32:47,355 INFO  [STDOUT] 17:32:47,355 DEBUG JaasConfiguration:206 - Configured JAAS entry found (Default not used) for: 'FileNetP8WSI'     org.jboss.security.auth.spi.UsersRolesLoginModule required;
17:32:47,367 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:315)
    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:592)
    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 com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:112)
    at com.filenet.api.util.UserContext.createSubject(UserContext.java:240)
    at alekso.filenet.ce.CEConnection.establishConnection(CEConnection.java:59)
    at alekso.filenet.ce.WSIConnector.GetDocument(WSIConnector.java:89)
    at Alekso.BasDemo.DAL.FileNetProxy.retrieveFile(FileNetProxy.java:43)
    at Alekso.BasDemo.Servlet.DownloadServlet.doDownload(DownloadServlet.java:67)
    at Alekso.BasDemo.Servlet.DownloadServlet.doGet(DownloadServlet.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    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:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    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.Ca开发者_开发百科chedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Thread.java:595)
17:32:47,417 INFO  [STDOUT] 17:32:47,416 DEBUG EngineRuntimeException:207 - com.filenet.api.exception.EngineRuntimeException: E_NOT_AUTHENTICATED: The user is not authenticated.
    at com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:127)
    at com.filenet.api.util.UserContext.createSubject(UserContext.java:240)
    at alekso.filenet.ce.CEConnection.establishConnection(CEConnection.java:59)
    at alekso.filenet.ce.WSIConnector.GetDocument(WSIConnector.java:89)
    at Alekso.BasDemo.DAL.FileNetProxy.retrieveFile(FileNetProxy.java:43)
    at Alekso.BasDemo.Servlet.DownloadServlet.doDownload(DownloadServlet.java:67)
    at Alekso.BasDemo.Servlet.DownloadServlet.doGet(DownloadServlet.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    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:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    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:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Thread.java:595)
Caused by: javax.security.auth.login.LoginException: Missing users.properties file.
    at org.jboss.security.auth.spi.UsersRolesLoginModule.login(UsersRolesLoginModule.java:148)
    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:592)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
    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 com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:112)
    ... 26 more
17:32:47,421 INFO  [STDOUT] 17:32:47,419 ERROR WSIConnector:100 - Errore nel documento con id {BDFCA4F2-B8C7-44EA-9481-4628C26A9DD5}
com.filenet.api.exception.EngineRuntimeException: E_NOT_AUTHENTICATED: The user is not authenticated.
    at com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:127)
    at com.filenet.api.util.UserContext.createSubject(UserContext.java:240)
    at alekso.filenet.ce.CEConnection.establishConnection(CEConnection.java:59)
    at alekso.filenet.ce.WSIConnector.GetDocument(WSIConnector.java:89)
    at Alekso.BasDemo.DAL.FileNetProxy.retrieveFile(FileNetProxy.java:43)
    at Alekso.BasDemo.Servlet.DownloadServlet.doDownload(DownloadServlet.java:67)
    at Alekso.BasDemo.Servlet.DownloadServlet.doGet(DownloadServlet.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    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:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    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:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Thread.java:595)
Caused by: javax.security.auth.login.LoginException: Missing users.properties file.
    at org.jboss.security.auth.spi.UsersRolesLoginModule.login(UsersRolesLoginModule.java:148)
    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:592)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
    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 com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:112)
    ... 26 more
17:32:47,421 INFO  [STDOUT] 17:32:47,421 ERROR DownloadServlet:89 - Impossibile recuperare il file allegato
com.filenet.api.exception.EngineRuntimeException: E_NOT_AUTHENTICATED: The user is not authenticated.
    at com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:127)
    at com.filenet.api.util.UserContext.createSubject(UserContext.java:240)
    at alekso.filenet.ce.CEConnection.establishConnection(CEConnection.java:59)
    at alekso.filenet.ce.WSIConnector.GetDocument(WSIConnector.java:89)
    at Alekso.BasDemo.DAL.FileNetProxy.retrieveFile(FileNetProxy.java:43)
    at Alekso.BasDemo.Servlet.DownloadServlet.doDownload(DownloadServlet.java:67)
    at Alekso.BasDemo.Servlet.DownloadServlet.doGet(DownloadServlet.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    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:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    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:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Thread.java:595)
Caused by: javax.security.auth.login.LoginException: Missing users.properties file.
    at org.jboss.security.auth.spi.UsersRolesLoginModule.login(UsersRolesLoginModule.java:148)
    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:592)
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
    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 com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:112)
    ... 26 more

Can somebody suggest a solution? The stack trace talk about a users.properties file, but I don't have it neither in JBoss 6.0. And if I really need to create one in order to let JBoss 4.2.3 works, what should I put inside? I configure the connection against FileNet in my code, reading the parameter from elsewhere... what's the difference between jboss 4.2.3 and jboss 6.0 that's causing me these troubles?


Solved! It was a stupid mistake. In the file login-config.xml you need to add this

<application-policy name="FileNetP8WSI">
    <authentication>
        <login-module code="com.filenet.api.util.WSILoginModule" flag="required"/>
    </authentication>
</application-policy>

in order for the communication with Filenet to work. I mispelled it, that's why it didn't work.


Which transport protocol are you using? IIOP or WSI? If you're using WSI, then your app should theoretically work. Your CE is hosted on a Jboss 6.0 instance, right?

I assume that you're using the IIOP transport protocol. In that instance, your client app needs to have the same J2EE libs as the server app. I've never written a FileNet client on Jboss before, but using WebLogic or WAS, you need the same version of the .jar file on the client as you do on the server. So for example, if I was writing a client that was talking to a CE that was hosted on a WebLogic system, I would need to use the same version of weblogic.jar on the client as is hosted on the server.

It is possible to write a client that runs on a different version of Jboss as the CE, but you would need to use the WSI transport protocol. The good news is that you don't need to make any code changes - you just need to change your config to use WSI instead of IIOP.

0

精彩评论

暂无评论...
验证码 换一张
取 消