I have tried my every possible ways of adding class in different packages such as application class in package com.packagename and my controller in different package named model and when i try to execute the program it returns the default white label error and when i put the classes in the same package it runs successfully.
So i wanted to ask if there is any problem with the project or i need to give any path.
Before I have also tried notations that says component scan and all but that to did not came handy
Let's say your main class(which is annotated with #SpringBootApplication) is in the package "com.somepackage", then try putting your controller in "com.somepackage.controller"(It is recommended that other classes are placed in the subpackage of your main class). with this change it should work.
You put your classes in wrong places and your package are very messy. You should have a structure like this
--src
main
java
com.boltforever.moviecatalog
model
service
MyService.java
controller
MyController.java
MovieCatalogServiceApplication.java
And this should work
Related
I have added django-model-utils to an existing (large) project, and the build is now failing, as part of the build includes static type checking with mypy.
It complains that models that I have added objects = InheritanceManager() to, don't have attributes for reverse ForeignKeys, if the reverse FK is accessed in a method on that model. For example, take the following:
class Student(Model):
school = ForeignKey(School, related_name='students')
class School(Model):
objects = InheritanceManager() # IRL School is a subclass of some other model
def something(self):
return self.students.filter(...)
Then running mypy on it, will return:
error: "School" has no attribute "students"
And even if I remove the related_name, and use self.student_set (i.e. the default django relation), it will still produce the same type of error. Only removing the InheritanceManager fixes the static type checking. Of course, I'm using it for a reason as I need to select_subclasses elsewhere in the code.
Has anyone come across this, or have a fix?
django-stubs uses plugin to add all managers. This plugin is triggered only if added manager is a "subclass" (not just real subclass, but also recognizable by mypy as such) of models.Manager.
django-model-utils is untyped, so InheritanceManager is in fact Any for mypy, and plugin does not see it. To solve exactly this issue I was adding py.typed marker to django-model-utils as a CI stage after package installation. You can also use a fork with py.typed or create a stub package for django-model-utils. This can result in other issues and doesn't give good type checking (all unannotated methods have Any as implicit arguments and return type), but is better than nothing. For my needs the marker was sufficient.
py.typed marker is an empty file located in package root (venv/lib/.../django_model_utils/py.typed) - it tells mypy that package does not need separate stubs and contains all necessary types.
I have followed this tutorial to create a send email custom action using Java backed Webscript:
http://ecmstuff.blogspot.com/2012/04/adding-document-library-actions-in.html?showComment=1403279845779#c303784066266925848
As has been mentioned above, there is an AbstractWebScript class defined just to execute the action without using a freemaker template, but I get this error:
Cannot locate template processor for template sendDocInEmail.get.html
I guess, there is a problem with the -context.xml file
My files are placed in the following folders:
1. the java .class files are in \tomcat\webapps\alfresco\WEB-INF\classes (placed with the package structure)
2. sendDocInEmail.get.desc in \tomcat\shared\classes\alfresco\extension\templates\webscripts folder (with the package structure)
3. services-context.xml file in the folder \tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module (again with the package structure)
Please help!
Thanks in advance.
You most likely derived your class from DeclarativeWebScript which extends AbstractWebScript and adds the template processing. Make sure to derive your class from the latter.
I am creating a personal package with some S4 classes. When I run the Build and Reload button in the Rstudio IDE I get the next message.
in method for ‘checkNewItems’ with signature ‘"webSource"’: no definition for class "webSource"
The Class declaration webSource is in a different file where the checkNewItems method is and I am guessing that is the reason why I am getting that message. In the source code that I have makes more sense to have the class declaration in other place rather than next to the methods checkNewItems.
Which is the idiomatic workaround that R programmers use for this?
Also, from the point of view of the Lazyloading that R uses I assumed that this should not happen.
You should export your class. In your namespace file you add this:
exportClasses(webSource)
Tridion's user interface allows you to extend specific commands, which is a great way to modify the behavior of certain existing commands. In the configuration file of the editor this is done with a section like this:
<ext:commands>
<ext:command name="TextUnderline" extendingcommand="MyTextUnderline"/>
<ext:command name="TextStrikethrough" extendingcommand="MyTextStrikethrough"/>
I am working on a generic command extension class that can be used to modify the behavior of a number of commands:
<ext:commands>
<ext:command name="TextUnderline" extendingcommand="MyCommandExtension"/>
<ext:command name="TextStrikethrough" extendingcommand="MyCommandExtension"/>
So in this second configuration fragment, we have the same MyCommandExtension extending both TextUnderline and TextStrikethrough.
But now in the JavaScript for my MyCommandExtension, how can I determine which command was originally fired?
MyCommandExtension.prototype.isAvailable = function (selection, pipeline) {
...
console.log(this.properties.name);
...
};
In this scenario the this.properties.name will be logged as a less-than-useful-but-completely-correct:
"DisabledCommand"
I suspect that the information is available somewhere in the pipeline parameter, but haven't found it yet.
How can I find out the original command from MyCommandExtension?
Short answer: I couldn't.
I had to do something similar, and ended up having to extend various commands and set the "current" command as part of my "_execute" call (so I would now call _execute(selection, pipeline, originalCommand) for my command.
N
You cannot find out what the original command is. The assumption is that an extending command is specific to the command it extends and so would know which one it is extending. When creating generic extensions that work on different commands, I can see how it might be useful to know what the configuration would be.
Maybe you could add this as an Enhancement Request?
To work around it for now, you could create a base command with your logic - which takes the name of the command that it extends as a parameter. And then create specific classes for each command you which to extend, which just call the base command and pass in the name.
To put it differently, create a BaseExtendingCommand with all of the required methods - and then both a TextUnderlineExtendingCommand and TextStrikethroughExtendingCommand which call the methods on BaseExtendingCommand (and pass in "TextUnderline" and "TextStrikethrough", respectively, as arguments)
I am developing a dynamic mocking framework for Flex/AS3 and am having trouble with private/support types (ie. those declared outside the package {} in a class file).
In my ABC "file", I am declaring the instance with the PROTECTED_NAMESPACE class flag and with a PRIVATE_NS multiname. I have also experimented with giving it the same namespace as the class it is subclassing (eg. PRIVATE_NS("ContainerClass.as$123")).
No matter what I do, I always get the following error after loadBytes:
VerifyError: Error #1014: Class ContainerClass.as$123::PrivateClass could not be found.
I have experimented with loading the generated bytecode into the same ApplicationDomain as the private class (I use a child domain by default). I even tried registering a class alias before the load (though that was a bit of a stretch).
Am I forgetting anything or is it simply a restriction of the AVM?
Please note that I am fully aware that this is illegal in ActionScript 3.0, I am looking for whether this is actually possible in the AVM.
Edit: For those interested in the work so far, the project is asmock and is on sourceforge.
I'm no expert with ABC files but I just don't think this is possible in the AVM2. I did several tests a while ago with the AS3 Eval lib and they all failed.
Related to dynamic mocking, I have filed an issue in Adobe bugbase, asking for a dynamic proxy mechanism: http://bugs.adobe.com/jira/browse/ASC-3136
I'm not sure what you mean by PRIVATE_NS("ContainerClass.as$123"), My reading of avm2overview.pdf 4.4.1 is that private namespaces are not permitted to have a name, hence that the "<class name>$<number>" namespace in debug output is generated for your convenience. I would assume that would mean you would have to hack your abc into the same abc tag in the source swf to access the namespace constant index (and that sounds too much like hard work to me!)
I haven't actually managed to generate a loading swf, though, so take this with a grain of salt.
Having gone back to look at this problem in ernest, I can definitively answer this question: private classes can only be referenced from the LoaderContext that loaded them
I have been able to add support for private interfaces by reproducing the interface in the loaded ABC 'file', but it cannot be coerced/cast back to the original private interface.
This is still useful for my requirements, as a private interface can be used to combine multiple interfaces.