2

I’m developing a Spring Boot app using Filenet CEAPI with EJB transport (the Filenet Web Service (CEWS) connection is not an options), but when I try to run my spring boot app, I get the following error over and over again in every second:

NMSV0307E: A java: URL name was used, but Naming was not configured to handle java: URL names. The likely cause is a user in error attempting to specify a java: URL name in a non-J2EE client or server environment. Throwing ConfigurationException.

My config is:

spring.version = 4.2.2.RELEASE

spring.boot.version = 1.2.7.RELEASE
                (I’ve tried 1.4.0.RELEASE, but I got the same results)

Websphere = 8.5 - this runs the Filenet Content Engine

Filenet & CEAPI = 5.2.1 - using EJB connection

I've used tutorial: http://www.notonlyanecmplace.com/how-to-connect-via-ejb-to-p8-5-2-and-websphere-v8-5/

I’ve enabled Tomcat JNDI naming using this Stackoverflow entry:

How to create JNDI context in Spring Boot with Embedded Tomcat Container

Although adding a breakpoint at the tomcat.enableNaming(); line does not stop...

I’m using this part of this solution:

@Bean
public TomcatEmbeddedServletContainerFactory tomcatFactory() {
    return new TomcatEmbeddedServletContainerFactory() {

        @Override
        protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer(
                Tomcat tomcat) {
            tomcat.enableNaming();
            return super.getTomcatEmbeddedServletContainer(tomcat);
        }
    };
}

I don’t use the rest, since I don’t want to lookup anything via JNDI, since Filenet API does that.

So to summarize it: could someone please tell me how to connect to a Filenet running on a Websphere 8.5 appserver via Filenet Java API over EJB transport protocol using Spring Boot 1.2.7 and Embedded Tomcat?

EDIT:

The Filenet API uses the following files optained from the Websphere server:

com.ibm.ws.orb_8.5.0.jar
com.ibm.ws.ejb.thinclient_8.5.0
key.p12
sas.client.props
ssl.client.props
trust.p12

EDIT #2:

I have a new set of log messages after refining logging:

2016-09-02 10:45:37.581 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [servletConfigInitParams]
2016-09-02 10:45:37.597 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [servletContextInitParams]
2016-09-02 10:45:37.597 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [jndiProperties]
2016-09-02 10:45:37.597 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [java:comp/env/context.listener.classes]
2016-09-02 10:45:37.598 ERROR 8820 --- [P=678944:O=0:CT] c.i.w.naming.java.javaURLContextFactory  : javaAccessorNotSet
2016-09-02 10:45:37.598 DEBUG 8820 --- [P=678944:O=0:CT] o.s.jndi.JndiLocatorDelegate             : Converted JNDI name [java:comp/env/context.listener.classes] not found - trying original name [context.listener.classes]. javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
2016-09-02 10:45:37.599 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [context.listener.classes]
2016-09-02 10:45:38.623 DEBUG 8820 --- [P=678944:O=0:CT] o.s.jndi.JndiPropertySource              : JNDI lookup for name [context.listener.classes] threw NamingException with message: Could not obtain an initial context due to a communication failure. Since no provider URL was specified, the default provider URL of "corbaloc:iiop:1.0@<MY_COMPUTERS_ADDRESS>:2809/NameService" was used.  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration.. Returning null.
2016-09-02 10:45:38.623 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [systemProperties]
2016-09-02 10:45:38.623 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [systemEnvironment]
2016-09-02 10:45:38.624 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [random]
2016-09-02 10:45:38.624 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'context.listener.classes' in [applicationConfigurationProperties]
2016-09-02 10:45:38.624 DEBUG 8820 --- [P=678944:O=0:CT] o.s.c.e.PropertySourcesPropertyResolver  : Could not find key 'context.listener.classes' in any property source. Returning [null]
2016-09-02 10:45:38.625 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [java:comp/env/spring.mandatoryFileEncoding]
2016-09-02 10:45:38.627 ERROR 8820 --- [P=678944:O=0:CT] c.i.w.naming.java.javaURLContextFactory  : javaAccessorNotSet
2016-09-02 10:45:38.627 DEBUG 8820 --- [P=678944:O=0:CT] o.s.jndi.JndiLocatorDelegate             : Converted JNDI name [java:comp/env/spring.mandatoryFileEncoding] not found - trying original name [spring.mandatoryFileEncoding]. javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
2016-09-02 10:45:38.627 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [spring.mandatoryFileEncoding]
2016-09-02 10:45:39.634 DEBUG 8820 --- [P=678944:O=0:CT] o.s.jndi.JndiPropertySource              : JNDI lookup for name [spring.mandatoryFileEncoding] threw NamingException with message: Could not obtain an initial context due to a communication failure. Since no provider URL was specified, the default provider URL of "corbaloc:iiop:1.0@<MY_COMPUTERS_ADDRESS>:2809/NameService" was used.  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration.. Returning null.
2016-09-02 10:45:39.635 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [java:comp/env/spring.mandatory_file_encoding]
2016-09-02 10:45:39.636 ERROR 8820 --- [P=678944:O=0:CT] c.i.w.naming.java.javaURLContextFactory  : javaAccessorNotSet
2016-09-02 10:45:39.636 DEBUG 8820 --- [P=678944:O=0:CT] o.s.jndi.JndiLocatorDelegate             : Converted JNDI name [java:comp/env/spring.mandatory_file_encoding] not found - trying original name [spring.mandatory_file_encoding]. javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
2016-09-02 10:45:39.637 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [spring.mandatory_file_encoding]
2016-09-02 10:45:40.645 DEBUG 8820 --- [P=678944:O=0:CT] o.s.jndi.JndiPropertySource              : JNDI lookup for name [spring.mandatory_file_encoding] threw NamingException with message: Could not obtain an initial context due to a communication failure. Since no provider URL was specified, the default provider URL of "corbaloc:iiop:1.0@<MY_COMPUTERS_ADDRESS>:2809/NameService" was used.  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration.. Returning null.
2016-09-02 10:45:40.646 DEBUG 8820 --- [P=678944:O=0:CT] org.springframework.jndi.JndiTemplate    : Looking up JNDI object with name [java:comp/env/spring.mandatory-file-encoding]
2016-09-02 10:45:40.646 ERROR 8820 --- [P=678944:O=0:CT] c.i.w.naming.java.javaURLContextFactory  : javaAccessorNotSet
Community
  • 1
  • 1
Kumite
  • 2,129
  • 3
  • 15
  • 15

2 Answers2

0

As the NMSV0307E WebSphere error says, you cannot use the java: namespace outside of a managed environment (application server or application client). You need to find the actual binding name of the EJB, for example by looking for relevant CNTR0167I messages in the SystemOut.log of the WebSphere Application Server that contains the EJB, and then use that name for your lookup.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90
0

can you share your code

but here in a glance

if you will use the Embedded tomcat you have to use WSI and for EJB you should not use the Embedded tomcat and deploy it as a WAR in Websphere or Jboss or WebLogic because they support EJB Transport, for example connection with WSI

public static final String CE_URI_WSI = "http://localhost:9080/wsi/FNCEWS40MTOM";
    public static final String CE_URI_EJB = "iiop://localhost:9080/FileNet/Engine";
    public static final String stanzaWSI= "FileNetP8WSI";
    public static final String STANZA_EJB = "FileNetP8";


public void connCPE_WSI() {
    // Get the connection
    conn = Factory.Connection.getConnection(CE_URI_WSI);
    // Get the user context
    uc = UserContext.get();
    uc.pushSubject(UserContext.createSubject(conn, username, password, stanzaWSI));
    try {
        // Get the default domain
        Domain domain = Factory.Domain.getInstance(conn, null);
        // Get an object store
        ObjectStore os = Factory.ObjectStore.fetchInstance(domain, osName, null);
        System.out.println("Con OKAY WSI");
        System.out.println(os.get_DisplayName());
    } finally {
        // Pop the subject off the UserContext stack
        uc.popSubject();
    }
}

enter image description here

enter image description here

for more info this is a great book FileNet P8 API

Ismail
  • 1,668
  • 1
  • 15
  • 10