jodd
Jodd is set of open-source Java tools and micro frameworks; compact, yet powerful. Jodd = tools + ioc + mvc + db + aop + tx + json + html < 1.5 Mb
Jodd | The Unbearable Lightness of Java jodd is set of java micro frameworks, tools and utilities, under 1.5 mb.
In Jodd BeanUtil
class does not have a method that will copy data from one object to another, i.e. in apache commons BeanUtils
class there is a method copyProperties
that will copy data from one object to another.
In Jodd we have to pass the name of the field and its value. If there are like 20+ fields do we have to do this manually for all the 20 fields or is there a better way of doing it using Jodd BeanUtil
.
Source: (StackOverflow)
I'm using a framework (Jodd) which is adding the table alias to the column names in a SQL Select. It looks like well-formed SQL, but Postgres chokes on it.
update GREETING Greeting
set Greeting.ID=5,
Greeting.NAME='World',
Greeting.PHRASE='Hello World!'
where (Greeting.ID=5)
gives an error:
Error: ERROR: column "greeting" of relation "greeting" does not exist
SQLState: 42703
Is there a way to get Postgres to accept that SQL? My other alternative is to hack the framework, which I don't want to do.
Source: (StackOverflow)
I am using Jodd Madvoc web framework and define actions (classes and methods) using annotations. Everything works fine, but now I need to have these action definitions in an external file, so Madvoc don't need to scan my class path for the action classes (and for some other reasons).
I could probably code this by myself, since Madvoc is quite open for extension, but just wonder if there is already a way to do this?
Thank you!
Source: (StackOverflow)
I am working on a system that uses drools to evaluate certain objects. However, these objects can be of classes that are loaded at runtime using jodd. I am able to load a file fine using the following function:
public static void loadClassFile(File file) {
try {
// use Jodd ClassLoaderUtil to load class into the current ClassLoader
ClassLoaderUtil.defineClass(getBytesFromFile(file));
} catch (IOException e) {
exceptionLog(LOG_ERROR, getInstance(), e);
}
}
Now lets say I have created a class called Tire and loaded it using the function above. Is there a way I can use the Tire class in my rule file:
rule "Tire Operational"
when
$t: Tire(pressure == 30)
then
end
Right now if i try to add this rule i get an error saying unable to resolve ObjectType Tire. My assumption would be that I would somehow need to import Tire in the rule, but I'm not really sure how to do that.
Source: (StackOverflow)
I want to use the Jodd library in java because I want to try Jerry out.
To do that I've included the library like shown in the answer to this question and used the following code:
File file = new File(SystemUtil.getTempDir(), "test.html");
NetUtil.downloadFile("http://de.wikipedia.org/wiki/Toastbrot", file);
Jerry doc = Jerry.jerry(FileUtil.readString(file));
Executing this code produces the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at jodd.lagarto.LagartoParserEngine.<clinit>(LagartoParserEngine.java:22)
at jodd.jerry.Jerry$JerryParser.createLagartoDOMBuilder(Jerry.java:80)
at jodd.jerry.Jerry$JerryParser.<init>(Jerry.java:73)
at jodd.jerry.Jerry.jerry(Jerry.java:121)
at jodd.jerry.Jerry.jerry(Jerry.java:53)
at sla.htmlf.Main.test(Main.java:36)
at sla.htmlf.Main.main(Main.java:19)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
... 7 more
at sla.htmlf.Main.test(Main.java:36)
at sla.htmlf.Main.main(Main.java:19) of course is referring to classes of my project
This is the first time I encountered a NoClassDefFound exception. It appears that org.slf4j.LoggerFactory is missing, but if I'm not mistaken thats something the jodd library uses - which then should be included there, right?
I'd really appreciate some advice/help with this
Source: (StackOverflow)
At the main page of the Jodd email library http://jodd.org/doc/email.html
there is a very specific example on how to use the library to embed an image (and not just simply attach it as a file) to an email you are about to send.
Unfortunately the resulting Content-Type of the part of the email that contains the image is:
Content-Type: application/octet-stream
But in order to display it correctly we need this Content-Type:
Content-Type: image/png
if you have a png image for instance.
But I cannot seem to find how to configure this inside the Jodd email library..
This is what I am seeking for. Thank you :)
Source: (StackOverflow)
I'm using Jodd DbOom to manage my queries and it's really awesome. But right now I'm are facing an undocumented situation.
I have a query that returns a list of objects(A), and each A has a list of objects (B), and each B is joined with other objects(C, D, E, etc). The problem is that the class JoinHintResolver
doesn't set the values C, D, E on the B objects. The B objects are set correctly on the A objects.
Below is a test method to reproduce the error. The other used classes(Girl
, BadBoy
) are from Jodd test packages.
public void testHintsList() {
Room room = new Room();
Girl girl = new Girl();
BadBoy badBoy = new BadBoy();
Object[] data = new Object[] { room, badBoy, girl };
JoinHintResolver jhr = new JoinHintResolver();
Object[] result = jhr.join(data, "room, room.boys, room.boys.girl");
assertEquals(1, result.length);
assertTrue(result[0] instanceof Room);
room = (Room) result[0];
badBoy = room.getBoys().get(0);
assertEquals(girl, badBoy.girl);
}
public class Room {
private Long id;
private List<BadBoy> boys;
public Room() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public List<BadBoy> getBoys() {
return boys;
}
public void setBoys(List<BadBoy> boys) {
this.boys = boys;
}
}
The documentation doesn't have any example like this, and Google neither. So I don't know if I did something wrong, or if Jodd wasn't prepared for this situation.
How could I set the hints so that Jodd would set the values correctly?
Source: (StackOverflow)
My Program not error is perfect work but I feel annoyed from warning message.
So, I want to hide it from program console. What should I do?
(i can't edit html source code)
[Thread-4] WARN jodd.lagarto.dom.LagartoDOMBuilderTagVisitor - Orphan closed tag ignored </meta>
[Thread-3] WARN jodd.lagarto.dom.LagartoDOMBuilderTagVisitor - Unclosed tag closed: <p>
Thanks for kindness.
Source: (StackOverflow)
I was trying to build a simple auth mechanism using madvoc and interceptors but it seems that the tutorial at
http://jodd.org/doc/example/auth-with-interceptors.html
is a little bit outdated.
I think that the tag was removed and I was not able to find the substituent.
How should we use the form in general and what is the recommended auth mechanism?
P.S. - I`m using latest jodd version.
Source: (StackOverflow)
I'm trying to use Jetty to deploy a Jodd servlet. My build tool is Gradle. When I call gradle jettyRun
, I get a ClassNotFound exception. I've tried adding various jars to the runtime, but I can't seem to find one that fixes this exception.
Here's my build.gradle:
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'war'
apply plugin: 'jetty'
repositories {
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-log4j12:1.7.5'
compile 'org.jodd:jodd-madvoc:3.4.4'
compile 'org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016'
testCompile 'junit:junit:4.11'
testCompile 'org.hamcrest:hamcrest-all:1.3'
}
and I get the following stack trace:
2013-07-03 00:51:00 INFO Madvoc:180 - Madvoc starting...
2013-07-03 00:51:00 INFO Madvoc:185 - Madvoc web application: com.ziroby.meeting.madvoc.MyWebApplication
2013-07-03 00:51:00 INFO Madvoc:268 - Loading Madvoc parameters from: /madvoc.props
2013-07-03 00:51:00 INFO Madvoc:288 - Configuring Madvoc using default automagic configurator
failed org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext@6ad4f3ec{/server,/windows/Users/ziroby/git/rc-meeting/server/src/main/webapp}: java.lang.NoClassDefFoundError: org/eclipse/core/resources/IWorkspaceRunnable
failed ContextHandlerCollection@728e5d0d: java.lang.NoClassDefFoundError: org/eclipse/core/resources/IWorkspaceRunnable
failed HandlerCollection@607f3b3c: java.lang.NoClassDefFoundError: org/eclipse/core/resources/IWorkspaceRunnable
Error starting handlers
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IWorkspaceRunnable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:787)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:447)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.getDeclaringClass(Native Method)
at java.lang.Class.getEnclosingClass(Class.java:1107)
at java.lang.Class.getSimpleBinaryName(Class.java:1242)
at java.lang.Class.getSimpleName(Class.java:1134)
at java.lang.Class.isAnonymousClass(Class.java:1210)
at jodd.madvoc.config.AutomagicMadvocConfigurator.checkClass(AutomagicMadvocConfigurator.java:118)
at jodd.madvoc.config.AutomagicMadvocConfigurator.onActionClass(AutomagicMadvocConfigurator.java:138)
at jodd.madvoc.config.AutomagicMadvocConfigurator.onEntry(AutomagicMadvocConfigurator.java:97)
at jodd.io.findfile.ClassFinder.scanEntry(ClassFinder.java:375)
at jodd.io.findfile.ClassFinder.scanJarFile(ClassFinder.java:268)
at jodd.io.findfile.ClassFinder.scanPath(ClassFinder.java:237)
at jodd.io.findfile.ClassFinder.scanPaths(ClassFinder.java:178)
at jodd.madvoc.config.AutomagicMadvocConfigurator.configure(AutomagicMadvocConfigurator.java:80)
at jodd.madvoc.config.AutomagicMadvocConfigurator.configure(AutomagicMadvocConfigurator.java:64)
at jodd.madvoc.WebApplication.configure(WebApplication.java:245)
at jodd.madvoc.Madvoc.start(Madvoc.java:218)
at jodd.madvoc.Madvoc.startNewWebApplication(Madvoc.java:153)
at jodd.madvoc.MadvocContextListener.contextInitialized(MadvocContextListener.java:26)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1272)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:489)
at org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext.doStart(JettyPluginWebAppContext.java:112)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.gradle.api.plugins.jetty.internal.Jetty6PluginServer.start(Jetty6PluginServer.java:111)
at org.gradle.api.plugins.jetty.AbstractJettyRunTask.startJettyInternal(AbstractJettyRunTask.java:247)
at org.gradle.api.plugins.jetty.AbstractJettyRunTask.startJetty(AbstractJettyRunTask.java:198)
at org.gradle.api.plugins.jetty.AbstractJettyRunTask.start(AbstractJettyRunTask.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
at org.gradle.api.plugins.jetty.JettyRun_Decorated.invokeMethod(Unknown Source)
at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:217)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:199)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:526)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:509)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter$1.run(CacheLockReleasingTaskExecuter.java:35)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter.execute(CacheLockReleasingTaskExecuter.java:33)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.ContextualisingTaskExecuter.execute(ContextualisingTaskExecuter.java:34)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter$1.run(CacheLockAcquiringTaskExecuter.java:39)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter.execute(CacheLockAcquiringTaskExecuter.java:37)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:282)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:48)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:34)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:27)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:89)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.resources.IWorkspaceRunnable
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 140 more
Source: (StackOverflow)
I have a DAO and a Service class each implements a interface:
public interface TemperatureDao extends GenericDAO<TemperatureLog> {
public abstract List<TemperatureLog> getLastHourTemperatures();
}
@PetiteBean(value="temperatureDao",wiring=WiringMode.AUTOWIRE)
public class TemperatureDaoImpl extends GenericAbstractDAO<TemperatureLog> implements TemperatureDao {
@Override
public List<TemperatureLog> getLastHourTemperatures(){
//do stuff here
return temps;
}
}
and
public interface TemperatureService {
public abstract boolean save(TemperatureLog t);
public abstract List<TemperatureLog> getLastHoutTemperatures();
}
@PetiteBean(value="temperatureService",wiring=WiringMode.AUTOWIRE)
public class TemperatureServiceImpl extends GenericService implements TemperatureService {
@PetiteInject
private TemperatureDao temperatureDao;
public TemperatureDao getTemperatureDao() {
return temperatureDao;
}
public void setTemperatureDao(TemperatureDao temperatureDao) {
this.temperatureDao = temperatureDao;
}
@Override
public boolean save(TemperatureLog t){
try {
temperatureDao.saveOrUpdate(t);
return true;
}catch(Exception e) {
return false;
}
}
@Override
@Transaction(propagation = JtxPropagationBehavior.PROPAGATION_REQUIRED, readOnly = true,isolation=JtxIsolationLevel.ISOLATION_READ_COMMITTED)
public List<TemperatureLog> getLastHoutTemperatures(){
return temperatureDao.getLastHourTemperatures();
}
}
and the problem is that temperatureDao
is not injected as i get NullPointerException
here:
return temperatureDao.getLastHourTemperatures();
The logs looks fine to me :
127 [DEBUG] j.p.PetiteBeans.registerPetiteBean:244 - Registering bean: temperatureDao of type: TemperatureDaoImpl in: SingletonScope using wiring mode: AUTOWIRE
128 [DEBUG] j.p.ProxettaBuilder.process:187 - processing: ro/videanuadrian/smartHome/dao/impl/TemperatureDaoImpl
128 [DEBUG] j.p.ProxettaBuilder.define:228 - proxy not applied ro.videanuadrian.smartHome.dao.impl.TemperatureDaoImpl
134 [DEBUG] j.p.PetiteBeans.registerPetiteBean:244 - Registering bean: temperatureService of type: TemperatureServiceImpl in: SingletonScope using wiring mode: AUTOWIRE
135 [DEBUG] j.p.ProxettaBuilder.process:187 - processing: ro/videanuadrian/smartHome/services/impl/TemperatureServiceImpl
139 [DEBUG] j.p.ProxettaBuilder.define:243 - proxy created ro.videanuadrian.smartHome.services.impl.TemperatureServiceImpl
So, any idea what I'm I missing here?
Source: (StackOverflow)
I am using jodd in my project. I am using lots of functionality jodd like madvoc , petite. I am looking functionality like apache tiles framework I have seen and read the post http://jodd.org/doc/decora/ but I don't get to much. Can any one provide working example of decora.
Source: (StackOverflow)
Recently, I found a class name like QueryMap
in Jodd. What is the use of this class? Is it an internal class of Jodd framework, or is it a utility for use?
Source: (StackOverflow)
I am trying to use the Jodd-http version 3.6.6
library in a simple application. The application runs fine on a test machine which has java 1.8
installed but when I try to run the same application on another machine with java 1.7
it throws this excption.
java.lang.NoSuchMethodError: jodd.Jodd.init(Ljava/lang/Class;)V
is this version of jodd-http
is not compatible with java 1.7
?
Source: (StackOverflow)
I am using Jodd Lagarto to parse some HTMLs. For some cases I also use Jerry, when I need to quickly process HTML. But now, I have some XMLs that I need to process. From the TagVisitor
it looks like Lagarto may process XMLs as well (that would be awesome for me), but... I am not quite sure on how to do this.
Did anyone used Jodd Lagarto to process XMLs and how?
Source: (StackOverflow)