rootContext && dispatcher-servlet are not being initialized - spring-mvc

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.

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.

Corda enterprise 3.2 fails to load custom configuration file

We've built a CordApp which connects with RabbitMQ and requires a configuration file to configure the subscribers and publishers to the message queues.
The CorDapp is build against 3.2-corda but fails to load the configuration file when running on a Corda Enterprise 3.2 node.
The following exception is appended to the logs when we start the Corda web server:
Starting as webserver: localhost:8080 [ERROR] 11:59:24+0000 [main]
messaging.XXX.initializeQueues - Exception caught when subscribing to
Rabbit queues [ERROR] 11:59:24+0000 [main]
messaging.XXX.initializeQueues -
net.corda.nodeapi.internal.config.ConfigUtilities.parseAs(Lcom/typesafe/config/Config;Lkotlin/reflect/KClass;)Ljava/lang/Object;
java.lang.NoSuchMethodError:
net.corda.nodeapi.internal.config.ConfigUtilities.parseAs(Lcom/typesafe/config/Config;Lkotlin/reflect/KClass;)Ljava/lang/Object;
Nov 27, 2018 11:59:25 AM
org.glassfish.jersey.internal.inject.Providers checkProviderRuntime
The code that loads the configuration is as follows:
val connectionConfig = defaultConfig!!
.resolve()
.getConfig("app-integration.rabbitMqConnectionConfiguration")
.parseAs<RabbitMqConnectionConfiguration>()
Given we are using a generic parseAs<RabbitMqConnectionConfiguration>() method, we assume that this is intended to subsequently call a parseAs(Config, KClass): Object method, but for some reason, it seems to be missing?
I would actually take a look at #joel's suggestion above. Corda is not an 'open core' project just yet.
So it's possible that you should compile the cordapps against the enterprise jar to determine whether the issue is the app or a different API between the two corda versions.
My other suspicion is that there might be different versions of java that are being used in the corda OS and the corda enterprise.
I would also see if this issue persists in the latest version of corda as well.

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.

CDI (Weld) / Seam 3 Persistence module / Glassfish 3 - Unexplainable exception when starting server

I am using Weld, Jboss' implementation of CDI. JPA/Hibernate for persistence. For something different I am giving it a crack on Glassfish 3 which I have not used before. I am using Maven for dependency management.
As CDI doesn't have transaction management included out of the box, I decided to use the Seam 3 Persistence module instead of rolling my own. Now, I am well aware that this is only in Alpha at the moment so maybe I am asking for trouble. I'm hoping someone else has seen this and can either help me fix it or at least let me know why I'm getting the problems that I am.
So, before adding the persistence module, everything builds and runs fine. I can open the homepage of the app fine. However, when I add the Seam 3 persistence module to my pom.xml, the application throws an exception when starting up. The only difference between working and not working is the one dependency I am adding to the pom.xml
The dependency I am adding to my pom.xml is:
<dependency>
<groupId>org.jboss.seam.persistence</groupId>
<artifactId>seam-persistence-impl</artifactId>
<version>3.0.0.Alpha1</version>
</dependency>
I added this dependency based on the instructions at http://seamframework.org/Seam3/PersistenceModule . I'm aware that when clicking on the documentation from this page it mentions a couple of other dependencies but I get the same problem when adding them as well. This is the dependency that I have narrowed the problem down to.
So, after adding the dependency above and starting the server I get the following on startup:
INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Grizzly Framework 1.9.18-o started in: 113ms listening on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 33ms listening on port 4848
INFO: Grizzly Framework 1.9.18-o started in: 76ms listening on port 8181
INFO: Starting Grizzly Framework 1.9.18-o - Thu Oct 28 23:06:04 BST 2010
INFO: Grizzly Framework 1.9.18-o started in: 10ms listening on port 3700
INFO: Starting Grizzly Framework 1.9.18-o - Thu Oct 28 23:06:04 BST 2010
INFO: Grizzly Framework 1.9.18-o started in: 7ms listening on port 7676
INFO: The Admin Console is already installed, but not yet loaded.
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(4429ms) startup services(1530ms) total(5959ms)
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Grizzly Framework 1.9.18-o started in: 16ms listening on port 8080
INFO: Binding RMI port to *:8686
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://192.168.1.73:8686/jndi/rmi://192.168.1.73:8686/jmxrmi
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /Applications/NetBeans/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/Q0/Q00qqJF1Gi8VesnYN54iM++++TI/-Tmp-/fileinstall-2957414086269585283, felix.fileinstall.filter = null}
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/Q0/Q00qqJF1Gi8VesnYN54iM++++TI/-Tmp-/fileinstall--8933010182761076907, felix.fileinstall.filter = null}
INFO: Started bundle: file:/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.scr.jar
INFO: Started bundle: file:/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/osgi-web-container.jar
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....
INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: Updating configuration from org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: Installed /Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /Applications/NetBeans/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/Q0/Q00qqJF1Gi8VesnYN54iM++++TI/-Tmp-/fileinstall-9012588867170808207, felix.fileinstall.filter = null}
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Portable JNDI names for EJB EjbSynchronizations : [java:global/com.coffeesnobs_web_war_1.0-SNAPSHOT/EjbSynchronizations, java:global/com.coffeesnobs_web_war_1.0-SNAPSHOT/EjbSynchronizations!org.jboss.seam.persistence.transaction.LocalEjbSynchronizations]
INFO: WELD-000900 1.0.1 (SP3)
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
SEVERE: Exception while loading the app
org.glassfish.deployment.common.DeploymentException: Exception #0 :null
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception #0 :null
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:45)
at org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl.fire(ProcessAnnotatedTypeImpl.java:44)
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:61)
at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:88)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:377)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:165)
... 30 more
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 14ms listening on port 8181
As you can see, there really isn't much to go on.
Have you seen this exception before? Do you have any idea what is causing it? And finally, do you know how to fix it?
I've been seeing this too. I increased the loggin on Glassfish and found the following.
FINER: loadClass(org.jboss.logging.MessageLogger)
FINER: Delegating to classloader1 org.glassfish.internal.api.DelegatingClassLoader#6f9240a4
FINER: Searching local repositories
FINER: findClass(org.jboss.logging.MessageLogger)
FINER: findClassInternal(org.jboss.logging.MessageLogger)
FINER: --> Passing on ClassNotFoundException
SEVERE: Exception while loading the app
org.glassfish.deployment.common.DeploymentException: Exception #0 :null
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception #0 :null
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:45)
at org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl.fire(ProcessAnnotatedTypeImpl.java:44)
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:61)
at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:88)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:377)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:165)
... 30 more
It looks like there is a JBoss logging dependency problem. MessgeLogger is a new class in the jboss logging framework that the new Seam extensions appear to be using.
I added the following to my pom
<dependency>
<groupId>org.jboss.slf4j</groupId>
<artifactId>slf4j-jboss-logging</artifactId>
<version>1.0.2.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-log4j</artifactId>
<version>2.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.0.0.Beta4</version>
</dependency>
This seems to have fixed the missing class but now I get a NPE.
Caused by: java.lang.NullPointerException
at org.apache.log4j.LogManager.getLogger(LogManager.java:188)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at org.jboss.logging.Log4jLogger.<init>(Log4jLogger.java:35)
at org.jboss.logging.Log4jLoggerProvider.getLogger(Log4jLoggerProvider.java:33)
at org.jboss.logging.Logger.getLogger(Logger.java:2164)
at org.jboss.slf4j.JBossLoggerFactory.getLogger(JBossLoggerFactory.java:66)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:246)
at org.hibernate.search.util.LoggerFactory.make(LoggerFactory.java:38)
at org.hibernate.search.store.FSDirectoryProvider.<clinit>(FSDirectoryProvider.java:55)
I think it's a log4j config problem on Glassfish.
It turns out it was a bug with the versions and combination of technologies we were using. We are now using the final version of Jboss 6 and the beta version of the Seam Persistence Module and all seems to be working ok.

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

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/

Resources