第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

NetBeans + Glassfish --> NoSuchMethodError

NetBeans + Glassfish --> NoSuchMethodError

慕絲7291255 2022-06-15 15:29:59
使用 api google-cloud-translate 時(shí)會(huì)發(fā)生以下異常。我正在使用應(yīng)用服務(wù)器 Glassfish 4、JSF 和 bootfaces 在 NetBeans 中開發(fā)一個(gè) Web 應(yīng)用程序。示例代碼:public void traducir (String text){Translate translate= TranslateOptions.getDefaultInstance().getService();   //Traduccion InglésTranslation translation = translate.translate(text,TranslateOption.sourceLanguage("es"), TranslateOption.targetLanguage("en")); String traduccionIngles =  translation.getTranslatedText(); System.out.println("Ingles traducido= " + traduccionIngles);}此方法引發(fā)以下運(yùn)行時(shí)異常    Advertencia:   #{subirFicheroManagedBean.traducirTextosNuevos()}: java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;javax.faces.FacesException: #{subirFicheroManagedBean.traducirTextosNuevos()}: java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)    at javax.faces.component.UICommand.broadcast(UICommand.java:315)    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
查看完整描述

2 回答

?
侃侃無極

TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個(gè)贊

I have executed the command "mvn dependency:tree -Dverbose -Dincludes=com.google.guava"


    [INFO] Scanning for projects...

    [INFO] 

    [INFO] --------------------< com.sample:traducionMvn >---------------------

    [INFO] Building traducionMvnPOM 1.0-SNAPSHOT

    [INFO] --------------------------------[ war ]---------------------------------

    [INFO] 

    [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ traducionMvn ---

    [INFO] com.cticontrol:traducionMvn:war:1.0-SNAPSHOT

    [INFO] \- com.google.guava:guava:jar:27.0.1-jre:compile

    [INFO]    +- com.google.guava:failureaccess:jar:1.0.1:compile

    [INFO]    \- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile

    [INFO] ------------------------------------------------------------------------

    [INFO] BUILD SUCCESS

    [INFO] ------------------------------------------------------------------------

    [INFO] Total time:  1.607 s

    [INFO] Finished at: 2019-02-18T11:27:14+01:00

    [INFO] ------------------------------------------------------------------------



my pom is:

  <!-- Dependecias API TRADUCTOR GOOGLE -->

        <dependency>

            <groupId>com.google.cloud</groupId>

            <artifactId>google-cloud-translate</artifactId>

            <!-- <version>1.61.0</version> -->

            <version>1.62.0</version>


            <exclusions>

                <exclusion>

                    <groupId>com.google.guava</groupId>

                    <artifactId>guava</artifactId>

                </exclusion>

                <exclusion>

                    <artifactId>com.google</artifactId>

                    <groupId>guava</groupId>

                </exclusion>

            </exclusions>


        </dependency>


        <dependency>

            <groupId>com.google.api-client</groupId>

            <artifactId>google-api-client</artifactId>

            <version>1.28.0</version>


            <exclusions>

                <exclusion>

                    <groupId>com.google.guava</groupId>

                    <artifactId>guava</artifactId>

                </exclusion>

                <exclusion>

                    <artifactId>com.google</artifactId>

                    <groupId>guava</groupId>

                </exclusion>

            </exclusions>


        </dependency>


        <dependency>

            <groupId>com.google.guava</groupId>

            <artifactId>guava</artifactId>

            <version>27.0.1-jre</version>

        </dependency>


        <!-- Fin dependencias API -->


------------------------------------

I keep giving the same error. 


查看完整回答
反對(duì) 回復(fù) 2022-06-15
?
翻閱古今

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超5個(gè)贊

發(fā)生這種情況是因?yàn)間oogle-api-client版本依賴于 Guava 的版本。不要在 pom.xml 中使用 guava依賴項(xiàng),而是嘗試更改為直接的android 變體:1.28.026.0-android27.0.1-jre-jre26.0-jre


    <dependency>

        <groupId>com.google.guava</groupId>

        <artifactId>guava</artifactId>

        <version>26.0-jre</version>

    </dependency>

有關(guān)此討論的更多信息,有一個(gè)小線程。


查看完整回答
反對(duì) 回復(fù) 2022-06-15
  • 2 回答
  • 0 關(guān)注
  • 98 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)