11 Replies Latest reply on Nov 27, 2013 11:39 AM by Amit Telang

    Need Jboss-client maven entry unable to send mail

    Amit Telang Newbie

      Hi,

       

      I am using Maven project and if I keep jboss-client.jar copied from jboss-eap-6.0/bin/client then at the time of submission my email functionality works fine. But due to Maven project I am unable to use jboss-client and as given in the documentation I need to use following entry for maven.But when I use this everything works fine but when appliation send any email it fails to send and gives the following exception:-

       

      22:33:13,825 ERROR [org.jboss.remoting.remote.connection] (Remoting "config-based-naming-client-endpoint" read-1) JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

       

      22:33:13,829 ERROR [com.genworth.longtermcare.group.messaging.EmailMessaginClient] (ajp-/10.16.143.29:8009-5) error to get InitialContext NamingException in sendMessage()javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed]

       

      My maven entry as given in the documentation is below:- 

      <dependencies>

       

      <dependency>

       

      <groupId>org.jboss.as</groupId>

       

      <artifactId>jboss-as-ejb-client-bom</artifactId>

       

      <type>pom</type>

       

      </dependency>

       

      <dependency>

       

      <groupId>org.jboss.as</groupId>

       

      <artifactId>jboss-as-jms-client-bom</artifactId>

       

      <type>pom</type>

       

      </dependency>

       

      </dependencies>

       

      Please let me know what I am doing wrong. Again if I put jboss-Client manually in my application war file lib then it works fine without issue. But I need maven solution.

      Thanks,

      Amit Telang

       

        • 1. Re: Need Jboss-client maven entry unable to send mail
          Wolf-Dieter Fink Master

          The JBREM000200 error seems not related to mails.

          First you should check whether the user/passwd is set correct.

          Also you might need some dependencies in your pom. You might have a look into the JBoss quickstarts see here, i.e. the ejb-remote might be helpful for you.

          • 2. Re: Need Jboss-client maven entry unable to send mail
            Amit Telang Newbie

            Hi, this problem I am only facing if I do not copy jboss-client.jar manually in my lib folder. Once jboss-client is avialable then everything works fine.But jboss-client.jar is not available in maven, so in jboss its suggested the above maven entry replacement for jboss-client. But when I do so I get above error message when application tries to send email.


            • 3. Re: Need Jboss-client maven entry unable to send mail
              Amit Telang Newbie

              Is there anyone to look into or advice on this issue. I think its more critical to know the alternate for jboss-client maven entry.

              • 4. Re: Need Jboss-client maven entry unable to send mail
                Amit Telang Newbie


                I found the issue in more detail:-

                When jboss-client is not in my lib then its failed to get InitialContent and throws Naming Exception.

                Hashtable<String, String> env = new Hashtable<String, String>();

                  env.put("java.naming.factory.initial",

                    "org.jboss.naming.remote.client.InitialContextFactory");

                  env.put("java.naming.provider.url", url);

                 

                Its throwing error on this page.

                 

                error to get InitialContext NamingException in sendMessage()javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed]

                 

                Thanks,
                Amit

                 

                • 5. Re: Need Jboss-client maven entry unable to send mail
                  Wolf-Dieter Fink Master

                  The artifacts of client.bom only provide the correct versions for the used libraries. You need to add the needed dependencies without the version.

                  See the ejb-remote/client/pom.xml as example.

                  The jboss-client.jar is a collection of several modules to make the use easy for a client.

                  To prevent from conflicts this collection is not provided as a maven archive.

                  • 6. Re: Need Jboss-client maven entry unable to send mail
                    Amit Telang Newbie

                    I am following these steps as mentioned in the README.txt file in the folder where jboss-client-7.1.0.Final.jar is located.

                    The README file says this:


                    Maven users should not use this jar, but should use the following BOM dependencies instead


                        <dependencies>

                            <dependency>

                                <groupId>org.jboss.as</groupId>

                                <artifactId>jboss-as-ejb-client-bom</artifactId>

                                <type>pom</type>

                            </dependency>

                            <dependency>

                                <groupId>org.jboss.as</groupId>

                                <artifactId>jboss-as-jms-client-bom</artifactId>

                                <type>pom</type>

                            </dependency>

                        </dependencies>


                    This is because using maven with a shaded jar has a very high chance of causing class version conflicts, which is why

                    we do not publish this jar to the maven repository.

                     

                    I tried this steps with/without version but its still failing at the time of Initial Context, which was working when using Jboss-client.jar.

                     

                    Still looking for help.

                     

                    Thanks,

                    Amit

                    • 7. Re: Need Jboss-client maven entry unable to send mail
                      Wolf-Dieter Fink Master

                      If you look to the complete README there is a list of used packages/artifacts which are shaded.

                      These must be partial used to have teh complete dependency.

                      • 8. Re: Need Jboss-client maven entry unable to send mail
                        Amit Telang Newbie

                        I only have this much information from README.txt of Jboss. Can you share what other details exists in this.

                        I would definately helpful for me.

                         

                        Thanks,

                        Amit

                        • 9. Re: Need Jboss-client maven entry unable to send mail
                          Amit Telang Newbie

                          Ok I think I need to add dependency for these many artifects also.

                           

                          org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec

                           

                          org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec

                           

                          org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec

                           

                          org.jboss:jboss-remote-naming

                           

                          org.jboss.logging:jboss-logging

                           

                          org.jboss.marshalling:jboss-marshalling

                           

                          org.jboss.marshalling:jboss-marshalling-river

                           

                          org.jboss.remoting3:jboss-remoting

                           

                          org.jboss.remoting3:remoting-jmx

                           

                          org.jboss.sasl:jboss-sasl

                           

                          org.jboss.xnio:xnio-api

                           

                          org.jboss.xnio:xnio-nio

                           

                          org.jboss.netty:netty

                           

                          org.hornetq:hornetq-core-client

                           

                          org.hornetq:hornetq-jms-client

                           

                          Thanks,

                          Amit

                           

                          • 10. Re: Need Jboss-client maven entry unable to send mail
                            Wolf-Dieter Fink Master

                            You only need to add the necessary lib's

                            i.e. you can drop hornetq/jms if the client did not use it.

                             

                            necessary for an ejb-client should be:

                            org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec

                            org.jboss:jboss-remote-naming  (only if you use the URL "remote://")

                            org.jboss.marshalling:jboss-marshalling

                            org.jboss.marshalling:jboss-marshalling-river

                            org.jboss.remoting3:jboss-remoting

                            org.jboss.sasl:jboss-sasl

                            org.jboss.xnio:xnio-api

                            org.jboss.xnio:xnio-nio

                             

                            1 of 1 people found this helpful
                            • 11. Re: Need Jboss-client maven entry unable to send mail
                              Amit Telang Newbie

                              Although adding this dependancies I was able to create InitalContext but stuck in other issue, where one of my application's messaging jar is giving runtime error on version issue complaining that its compiled with higher version lower version is needed.

                              Not sure if what diffrence here when I am not using jboss-client. But looks like due to adding new dependancies its impacting existing jars.

                              hrew exception: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.sBE3CCD47EE3E4BB4904C26E1B2FC6185.index) - code 3

                              at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1520) [xbean-2.1.0.jar:]

                              at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260) [xbean-2.1.0.jar:]

                              at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:183) [xbean-2.1.0.jar:]

                              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09]

                              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09]

                              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09]

                              at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09]