Flex 4, Spring 3 with Hibernate & MySQl setup + configuration issues - apache-flex

This kind of question has been asked before, but has not been well supported at StackOverlfow...maybe because some people think its elementary..but beginners like me have spent days on this but to no avail. Kindly help [I'm sure its going to be an ever occurring issue]
I'm trying to make a flex project and want to integrate Spring 3.0 with it and later Hibernate.
I was trying to follow James Ward's Refcard instructions - http://refcardz.dzone.com/refcardz/flex-4-and-spring-3 ,
Sadly, I got stuck at an initial point itself as some problem in deploying the project to JBoss (in refcardz it says Tomcat)..
I was trying to use the book 'Flex and Java integration Bible' [it uses JBoss], can somebody tell me if its the right way...or is there some other text ? please help as I have been stuck on this for 2 days now...I want to code and move ahead, not be stuck in configuration issues. I'll be most thankful.
UPDATE-MORE DETAILS :
I started off with using 'Flex and Java Integration Bible, as had no idea of how to integrate so many things (there is no text out there what so ever)'. When I reached the middle of the book, I was not able to do some steps as I guess the version of things changed.
I searched and went towards James Ward example (again, not very detailed for a stupid beginner like Me). Using Refcardz, I am stuck at following --
While making the flex spring project, I see the error in console that cannot deploy to server (tried both JBoss and Tomcat). Error trace is as follows (I think some jar as mentioned in Refcardz is to do with it) :
Oct 8, 2010 2:07:24 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_21\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Common Files\Lenovo;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Lenovo\Client Security Solution;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\WinSCP3\;C:\Program Files\Java\jdk1.6.0_21\bin;C:\apache-ant-1.8.1\bin;C:\Program Files\Java\jdk1.6.0_21\bin;C:\apache-ant-1.8.1\bin
Oct 8, 2010 2:07:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:flexspring' did not find a matching property.
Oct 8, 2010 2:07:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Oct 8, 2010 2:07:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 398 ms
Oct 8, 2010 2:07:24 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 8, 2010 2:07:24 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.flex.core.ExceptionTranslationAdvice] for bean with name 'org.springframework.flex.core.ExceptionTranslationAdvice#0' defined in null: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1238)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:549)
at org.springframework.flex.config.RemotingAnnotationPostProcessor.findRemotingDestinations(RemotingAnnotationPostProcessor.java:148)
at org.springframework.flex.config.RemotingAnnotationPostProcessor.postProcessBeanFactory(RemotingAnnotationPostProcessor.java:79)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:653)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1256)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1227)
... 25 more
Caused by: java.lang.ClassNotFoundException: org.aopalliance.aop.Advice
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
... 53 more
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/flexspring] startup failed due to previous errors
Oct 8, 2010 2:07:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Can somebody please give some step by step method to do so..or some existent text to get that intuition. I am a student and interning. Have not felt this helpless in years. I just can't make things happen. [I wonder am I the dumbest to have such a problem.]
Regards,
Chirayu
NEXT PROBLEM UPDATE-10/21/2010
The above problem was solved thanks to Splash and James(ans. below), but now after I have done as said in Refcardz, and the sayHello.mxml loads in browser, I enter text, and press sayHello button, upon which this error comes -
[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/flexsping/messagebroker/amf'"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:345]
at mx.rpc::Responder/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:68]
at mx.rpc::AsyncRequest/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:113]
at mx.messaging::ChannelSet/faultPendingSends()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1614]
at mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1206]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\Channel.as:1128]
at mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:406]
at mx.messaging.channels::AMFChannel/statusHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:453]
I have no idea what this means...ave spent toooo much of time on this...kindly please help me through. I am trying, and have tried everything..but now do need help of somebody who knows this well. I'll be really thankful.
-Chirayu

You need to deploy the jar for org.aopalliance.aop.Advice. I guess it is aopalliance-alpha1.jar (which is referenced in the refcard tutorial) which seems not to be in the classpath. This step is explained on page 2 of the Refcard tutorial:
Next, you need to add the dependencies to the flexspring web application. Copy all of the Spring Framework libraries / JAR files to the WebContent/WEB-INF/lib folder. [...] Do the same for aopalliance.jar, [...]
Please read the Refcard attentively. It's an in-depth walkthrough and should cover any needed step.
For more tutorials look at the Adobe Developer Connection:
Adobe Flex, BlazeDS, and Hibernate JPA on Tomcat and MySQL
The Flex, Spring, and BlazeDS full stack

Try using something other than bloated Spring garbage and especially "AOP" trash. Use pure-Java PicoContainer and ditch all that ridiculous XML dependency injection config (convention over configuration? ...yeah right) AND the outrageous number of jar hell dependencies (such as the aopappliance junk that is giving you trouble now).
Spring has had it's day, and won big championing a few good concepts like DI and TDD but the implementation of the concept sucks, at this point it's just an absurd number of sub-projects riding the Spring bandwagon. Now there are better alternatives out there which rely on actual Java programming rather than "XML programming".
If you're new you'll be spending time learning anyway, and I guarantee the learning curve for constructor-based Pico dependency injection is easier.
http://www.picocontainer.org/

Related

Taking PNG from Desktop while jar is running

I'm working on a project on an IDE, of course when using it I have no problems saving files into resources and using them. Though, I'm running the .jar of the project on a raspbian system and the image file is saved on Desktop, the same directory where the jar is saved, not a problem actually, the main problem is that I need to access that file and it does not let me, giving me a FileNotFoundException. Here is the code:
ImageIO.write(bi, "png", new File("mandelbrot.png"));
SendPhoto spr = new SendPhoto();
spr.setChatId(update.getMessage().getChatId());
spr.setReplyToMessageId(update.getMessage().getMessageId());
spr.setPhoto(new File("home/pi/Desktop/mandelbrot.png")); //I've also tried with ~/Desktop/mandelbrot.png
The exact error is the following one:
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {s}->https://api.telegram.org:443: home/pi/Desktop/mandelbrot.png (No such file or directory)
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://api.telegram.org:443
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {s}->https://api.telegram.org:443: home/pi/Desktop/mandelbrot.png (No such file or directory)
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://api.telegram.org:443
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.FileNotFoundException) caught when processing request to {s}->https://api.telegram.org:443: home/pi/Desktop/mandelbrot.png (No such file or directory)
Mar 07, 2019 6:24:58 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://api.telegram.org:443
I have little knowledge on how a jar file works, so I assume I'm doing something wrong, because it makes no sense otherwise since that directory exists.
I solved the problem, it was a misunderstanding. I needed to write just mandelbrot.png and not all to path to get to the file, since it's in the same directory. I leave this in case someone will need it.

Sonar : Fail to load plugin SonarPLSQL [plsql]

My SonarQube version is sonarqube-7.5 community edition.
Sonar Scanner version is sonar-scanner-3.3.0.1492-windows
I downloaded sonar-plsql-plugin-3.3.0.2273.jar and placed it in \sonarqube-7.5\extensions\plugins\ folder.
My operating system is Windows.
When I try to start SonarQube, I get the below exception in web.log file.
The PLSQL plugin which I am using is compatible with SonarQube 6.7+ and I am using version 7.5 (https://docs.sonarqube.org/display/PLUG/SonarPLSQL)
How could I resolve this issue and start the server?
2019.01.28 16:00:00 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.01.28 16:00:01 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.IllegalStateException: Fail to load plugin SonarPLSQL [plsql]
at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:82)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:586)
at org.sonar.server.platform.Platform.start(Platform.java:211)
at org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:185)
at org.sonar.server.platform.Platform.access$500(Platform.java:46)
at org.sonar.server.platform.Platform$1.lambda$doRun$0(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.runIfNotAborted(Platform.java:371)
at org.sonar.server.platform.Platform$1.doRun(Platform.java:119)
at org.sonar.server.platform.Platform$AutoStarterRunnable.run(Platform.java:355)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sonarsource/plugins/license/api/LicensedPluginRegistration
at com.sonar.plsql.plugin.PlSqlPlugin.define(Unknown Source)
at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:72)
... 9 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.sonarsource.plugins.license.api.LicensedPluginRegistration
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 11 common frames omitted
2019.01.28 16:00:02 INFO web[][o.s.p.StopWatcher] Stopping process
Sonar PLSQL plugin is a commercial product. You cannot install it on SonarQube Community edition. You have to buy at least Developer edition. Read more at Plans & Pricing.

rootContext && dispatcher-servlet are not being initialized

I am newly learning Spring MVC and facing a problem. I have configured my project correctly and all things were going well .For some reasons, I have done maven clean than maven install than update project.After that, if I run the project ->->-> rootContext && dispatcher-servlet are not being initialized. In the console just the following->
Dec 05, 2016 11:20:39 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1093 ms
Dec 05, 2016 11:20:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 801 ms
and in the browser->
HTTP Status 404 - /st/add
type Status report
message /st/add
description The requested resource is not available.
If I change the workspace and in a new project just paste the previous configuration, it works again.
How can i solve the problem without copying and pasting again and again?????
My project tree is-
-- src
-- main
-- webapp
-- WEB-INF
-- spring
--rootContext.xml
--dispatcher-servlet.xml
-- web.xml
As IDE, I am using Spring Suit Tool (STS) and as server Pivotal tc Server Developer Edition.

Spring MVC + Dandelion Datables Exception starting filter dandelionFilter

In my Spring MVC application I have used Dandelion Datatables 0.10.1, due to some performance issues I have decided to upgrade the version to 1.0.1 following the official migration guide from:
http://dandelion.github.io/components/datatables/1.0.0/docs/from-0.10.x-to-1.x.html
I have included all the required Maven dependencies, configured the web.xml accordingly to use also the Servlet 3.0 version but when I try to run the appplication I get the following exception during the dandelionFilter loading. Any help is appreciated.
Jul 20, 2015 7:23:08 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter dandelionFilter
java.lang.NoSuchFieldError: STRICT_DUPLICATE_DETECTION
at com.github.dandelion.core.web.handler.debug.AbstractDebugPage.<clinit>(AbstractDebugPage.java:71)
at com.github.dandelion.core.web.handler.debug.StandardDebugMenu.getPages(StandardDebugMenu.java:45)
at com.github.dandelion.core.Context.initDebugMenus(Context.java:574)
at com.github.dandelion.core.Context.init(Context.java:156)
at com.github.dandelion.core.Context.<init>(Context.java:127)
at com.github.dandelion.core.web.DandelionFilter.init(DandelionFilter.java:96)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
The strict duplication detection feature was added in Jackson-Core 2.3. See http://fasterxml.github.io/jackson-core/javadoc/2.3.0/com/fasterxml/jackson/core/JsonParser.Feature.html#STRICT_DUPLICATE_DETECTION
If possible, you should update this dependency to v2.3.x minimum.

SolrCloud server restart hangs

I am using SolrCloud with 2 shards (no replicas), both running in the same machine. I use a separate Zookeeper instance. The problem I am facing is that if I reboot the server, SolrCloud fails to start up .
Log in the first shard:
May 23, 2013 3:10:53 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example/solr/my-collection/data
May 23, 2013 3:10:53 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example/solr/my-collection/data/index
May 23, 2013 3:11:01 PM org.apache.solr.common.cloud.ZkStateReader$3 process
INFO: Updating live nodes... (2)
Log in the second shard:
May 23, 2013 3:11:09 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example2/solr/my-collection/data
May 23, 2013 3:11:09 PM org.apache.solr.core.CachingDirectoryFactory close
INFO: Releasing directory:/opt/solr-4.1.0/example2/solr/my-collection/data/index
To start the service, I have to delete the entire data folder in SolrCloud shards and start again. Deleting just the tlog folder also does not help. Is there a way to prevent this from happening.
There would be a zoo_data folder created in your solr home directory.Delete that folder and then do a restart.It might help in your case.

Resources