I am trying to create a new component ("hello.cmp") but when i try to run it on the server I always get error shown in the screen shot - aura-framework

I am trying to learn Aura. I am trying to create a new component ("hello.cmp") but when I try to run it on the server I always get the error shown in the screenshot. I have checked the server is up and running.
When I use this URL "http://localhost:8080/helloWorld/helloWorld.app"
it works fine:
however when i try the same with the newly created component "hello.cmp"
its doesn't work and i get the error as:
org.auraframework.throwable.AuraUnhandledException: Unable to process your request
org.auraframework.throwable.quickfix.DefinitionNotFoundException: No COMPONENT named markup://helloWorld:hello found
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)
I have restarted the server many times but still the problem remains the same.
PLease advice how to proceed.

I was having a similar problem when I was trying to run the aura server locally.
I think you might have the same problem I had and that is using the correct namespace. If you created a hello component try including it in your app as <hello:hello/>
In Salesforce it the namespace seems to default to "c"
e.g.
<c:component_name> / <c:app_name>
Below I'll explain how I understand the namespace to work, and you should play with this to get your component working:
src
src/main
src/main/webapp
src/main/webapp/WEB-INF
src/main/webapp/WEB-INF/components
src/main/webapp/WEB-INF/helloWorld <- this is the namespace
src/main/webapp/WEB-INF/helloWorld/helloWorld <- this nested folder is the component for the "helloWorld" namespace
src/main/webapp/WEB-INF/helloWorld/helloWorld/helloWorld.app
src/main/webapp/WEB-INF/hello <- different namespace
src/main/webapp/WEB-INF/hello/hello <- don't forget this component folder for the hello namespace
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>
Now if you want everything in the same name space all you need to do is make sure you have the folder structure correct:
src/main/webapp/WEB-INF/helloWorld/helloWorld/helloWorld.app
src/main/webapp/WEB-INF/helloWorld/hello/hello.cmp
Now you can use
<helloWorld:helloWorld/> or <helloWorld:hello/>
I hope that helps.

Related

Salesforce developer console - APEX runner

I am trying to run code in the developer console. From the "execute anonymous window". How do i access the case written in the console from the child window.
it shows the attached error when trying to execute
I am still getting the same error. screenshot below. Please let me know if the screenshots are visible otherwise i will upload somewhere else.
"Test" is a name of a built-in apex class used when writing unit tests. It's bad idea to name your own classes like the standard ones, it can lead to "fun" scenarios like "integer account = 5; sobject a = new account();"
https://developer.salesforce.com/docs/atlas.en-us.234.0.apexref.meta/apexref/apex_methods_system_test.htm
Make new class with similar body, delete that one and try your code again.
And since your method is static, you can do MyClass.myTest(), you don't need "new"

What is the correct usage of the mixin classs for TCL language?

Im attempting to update an old version of the selenium-tcl package to work with the new W3C WebDriver (or Selenium 4.0).
Original packages uses a few mixins for the webdriver class.
So I modeled what I saw and created a mixin file named mixin_action_chains.tcl [1] which has a mixin class called Mixin_Action_Chains.
Whenever I attempt to use it I get the error:
% package require selenium
::selenium::Mixin_Action_Chains does not refer to an object
Im not sure why I've modeled it pretty much exactly as I have seen in the other files such as mixin_for_scrolling.tcl [2]* file. What am I missing.
Here is the entire GitHub Repo
Im not sure what else must be done for TclOO. Any thoughts.
Thanks
Im not sure what else must be done for TclOO. Any thoughts.
Update
pkgIndex.tcl: The placement of the mixin-defining script mixin_action_chains.tcl is wrong, it comes after the mixin has already been required in the previously sourced script webdriver.tcl, like entering directly:
% oo::class create C {
mixin ::not::defined
}
::not::defined does not refer to an object
You need to change the order of source command calls in the package ifneeded script.
For the records
Still, in the original version, there were unbalanced curly braces and brackets in your script, which broke sourcing of the file for me:
https://github.com/SavSanta/w3cselenium-tcl/pull/1

Liferay 7.1 npm-react-module localization

I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization

jsp not recognizing a class even though I have imported in under proper packagename in eclipse

As you can see that it's not recognising the class MySqlConnection. Thus not allowing me to create its object. The class and package name is correct and its still not working. Is there something I am missing?
Typo... Try to change from MySqConnection to MySqlConnection.

Can Not Refactor Class Name in XCode

I am trying to rename the class name for a view controller (which has an associated .xib file) via XCode's refactoring tool. After entering a new name, I get this error message (no preview of changes):
The selection is not a type that can be renamed.
Make a different selection and try again.
I have tried all the suggestions in this SO thread, but no luck.
What could prevent XCode from being able to refactor a class (and related file names), when other classes and variables can be refactored without any problem?
I think you tried to change the classname by selecting the file and press refactor or you select it in the #import "classname".
Instead try to select "classname" in the interface definition after #interface
I also met this problem
Here is my solution
Move the whole Project to another place Then it works(to me)

Resources