7 Replies Latest reply on Nov 21, 2016 3:39 PM by Alla Winter

    import javax.json.*;  is not resolved for wildfly 10

    Alla Winter Newbie

      I have created Dynamic Web project in eclipse and also selected project facets: java, Dynamic Web Module, java Script, Jax-RS, but compiler is showing a compilation error for "import javax.json.*;"

      as well as indicated JAX-RX support.  javax.net.ssl.HttpsURLConnection is resolved , but   javax.json not.

      I thought that WildFly 10 is JEE7 complient and such library should be available.

      Please advise

       

      thanks

        • 1. Re: import javax.json.*;  is not resolved for wildfly 10
          Tomaz Cerar Master

          compile time != deploy time on wildfly

          • 2. Re: import javax.json.*;  is not resolved for wildfly 10
            Alla Winter Newbie

            I agreed, but I thought that if I specify the target run time for the project, then all jee libraries will be avaialble for compilation

            Tried to examen WildFile directory to see if this library is available and found the following

            in the directory: C:\WildFliy10.1\modules\system\layers\base\javax\json\api\main only one file

            - module.xml

                 -<module name="javax.json.api" xmlns="urn:jboss:module:1.3">-<properties><property name="jboss.api" value="public"/></properties>-<dependencies>-<module name="org.glassfish.javax.json" export="false">-<exports>-<include-set><path name="javax/json"/><path name="javax/json/spi"/><path name="javax/json/stream"/></include-set></exports></module></dependencies></module>

            in a contrast  in the directory C:\WildFliy10.1\modules\system\layers\base\javax\jms\api\main 2 files

            - module.xml :

                 -<module name="javax.jws.api" xmlns="urn:jboss:module:1.3">-<resources><resource-root path="jsr181-api-1.0-MR1.jar"/></resources></module

            - jsr181-api-1.0-MR1.jar

             

            Does that mean that WildFly10 is not shipped with jar file for json API at all, it is an SPI

            What can trigger this download?  Is it automatic, and I am not getting it because I am behind the proxy, or I have to do something to triger this download?

            • 3. Re: import javax.json.*;  is not resolved for wildfly 10
              jaikiran pai Master

              Alla Winter wrote:

               

              I have created Dynamic Web project in eclipse and also selected project facets: java, Dynamic Web Module, java Script, Jax-RS, but compiler is showing a compilation error for "import javax.json.*;"

              as well as indicated JAX-RX support. javax.net.ssl.HttpsURLConnection is resolved , but javax.json not.

              I thought that WildFly 10 is JEE7 complient and such library should be available.

              Please advise

               

              thanks

              This appears to be an IDE thing and not related to WildFly server in itself. I'm guessing you are using JBoss Tools? If yes, someone can move this thread to that forum and the people there might be able to help.

              • 4. Re: import javax.json.*;  is not resolved for wildfly 10
                Alla Winter Newbie

                If wildFly provides javax.json  implementation, where is this jar file within wildFly?

                thanks

                • 5. Re: import javax.json.*;  is not resolved for wildfly 10
                  Tomaz Cerar Master

                  in WILDFLY_HOME\modules\system\layers\base\org\glassfish\javax\json\main\javax.json-1.0.3.jar

                  • 6. Re: import javax.json.*;  is not resolved for wildfly 10
                    milspec Newbie

                    For our project, we have a 'dev_lib' directory which contains 'api jar files'

                    • developers compile against dev_lib/*.jar
                    • We don't packages these jars with our application because the app server provides the implementation

                     

                    This directory includes:

                    • javaee-api-7.0.jar
                    • javax.ws.rs-api-2.0.1.jar

                     

                    hth

                    • 7. Re: import javax.json.*;  is not resolved for wildfly 10
                      Alla Winter Newbie

                      thanks for responding on my question. 

                      I do not have jar file in this directory for 10,0 final version that I recently downloaded. 

                      Tomaz Cerar wrote:

                       

                      in WILDFLY_HOME\modules\system\layers\base\org\glassfish\javax\json\main\javax.json-1.0.3.jar

                      Instead I have xml file,module.xml, in this directory (C:\WildFliy10.1\modules\system\layers\base\javax\json\api\main)  that looks likethis

                       

                          -<module name="javax.json.api" xmlns="urn:jboss:module:1.3">

                                -<properties><property name="jboss.api" value="public"/></properties>

                                -<dependencies>

                                     -<module name="org.glassfish.javax.json" export="false">

                                          -<exports>

                                               -<include-set>

                                                    <path name="javax/json"/>

                                                    <path name="javax/json/spi"/>

                                                    <path name="javax/json/stream"/>

                                                 </include-set>

                                          </exports>

                                     </module>

                                </dependencies>

                           </module>

                       

                      So thequestion is how to make jboss to include jar file that is desribed in this matadata?