2017-01-23 18 views
0

我正在嘗試學習靈氣。我試圖創建一個新的組件(「hello.cmp」),但是當我嘗試在服務器上運行它時,我總是得到屏幕截圖中顯示的錯誤。我已檢查服務器已啓動並正在運行。我想創建一個新組件(「hello.cmp」),但是當我嘗試在服務器上運行它時,我總是在屏幕截圖中顯示錯誤

當我使用這個網址「http://localhost:8080/helloWorld/helloWorld.app」 它工作正常:

然而

當我嘗試用新創建的組件「hello.cmp」 同其不工作,我得到的錯誤是:

org.auraframework.throwable.AuraUnhandledException:無法處理您的請求

org.auraframework.throwable.quickfix.DefinitionNotFoundException:no組件命名標記://的helloWorld:你好發現

at org.auraframework.impl.DefinitionServiceImpl.getHelper(DefinitionServiceImpl.java:1427) 

at org.auraframework.impl.DefinitionServiceImpl.compileDef(DefinitionServiceImpl.java:1551) 

at org.auraframework.impl.DefinitionServiceImpl.compileDE(DefinitionServiceImpl.java:976) 

at org.auraframework.impl.DefinitionServiceImpl.getUid(DefinitionServiceImpl.java:718) 

at org.auraframework.impl.DefinitionServiceImpl.updateLoaded(DefinitionServiceImpl.java:588) 

at org.auraframework.http.AuraServlet.internalGet(AuraServlet.java:306) 

at org.auraframework.http.AuraServlet.doGet(AuraServlet.java:278) 

at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) 

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) 

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) 

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448) 

at org.auraframework.http.AuraTestFilter.innerFilter(AuraTestFilter.java:314) 

at org.auraframework.http.AuraTestFilter.doFilter(AuraTestFilter.java:186) 

我已經多次重新啓動服務器,但問題依然存在。

請教如何繼續。

回答

0

我在嘗試在本地運行光環服務器時遇到類似問題。

我想你可能會遇到同樣的問題,那就是使用正確的命名空間。如果你在你的應用程序中創建一個hello組件嘗試包括它作爲<hello:hello/>

在Salesforce中它的命名空間似乎默認爲「C」

例如

<c:component_name>/<c:app_name> 

下面我來解釋我是如何理解的命名空間的工作,你應該玩這個,讓您的工作成分:

SRC

的src/main

的src/main/webapp

src/main/webapp/WEB-INF

的src /主/ web應用/ WEB-INF /組件

的src /主/ web應用/ WEB-INF /的helloWorld < - 這是命名空間

的src /主/ web應用/ WEB-INF /的helloWorld /的helloWorld < - 這嵌套的文件夾是 「HelloWorld」 的命名空間

的src /主/ web應用/ WEB-INF /的helloWorld/helloWorld的組件/ helloWorld.app

的src /主/ web應用/ WEB-INF /你好< - 不同的命名空間

src/main/webapp/WEB-INF/hello/hello < - 不要忘記這個組件文件夾爲hello命名空間

src/main/webapp/WEB-INF/hello/hello/hello。CMP

helloWorld.app

<aura:application> 
    hello web, from the Aura sample app helloWorld 
    <hello:hello/> 
</aura:application> 

hello.cmp

<aura:component> 
    Hello, HTML! 
</aura:component> 

現在如果你想在同一個命名空間的一切,所有你需要做的就是確保你有文件夾結構正確:

src/main/webapp/WEB-INF/helloWorld/helloWorld/helloWorld.a第

的src /主/ web應用/ WEB-INF/helloWorld的/你好/ hello.cmp

現在你可以使用 <helloWorld:helloWorld/><helloWorld:hello/>

我希望幫助。

相關問題