The package structure was the problem.

I created a package "routes" underneath where the application is, and put my 
route there.
Thank you very much!

Sincerely,
 
Jeremy Cox
Software Engineer
Universal Gateway at Progeny Systems
 
Urgent contact: Text 859.322.3214
Email    jeremy....@progeny.net


-----Original Message-----
From: Mark Nuttall [mailto:mknutt...@gmail.com] 
Sent: Thursday, January 7, 2021 1:55 PM
To: users@camel.apache.org
Subject: Re: EXTERNAL: Re: Can't get routes to Start in SpringBoot / Camel 3.5.0

External E-mail --- CAUTION: This email originated from outside Progeny 
Systems. Do not click links or open attachments unless you recognize the sender 
and know the content is safe.

Did you try something simple like a direct route? If that does work and the 
quartz one doesn't work then it is configured wrong.
If neither do, try ensuring the Component is being created. Put a log statement 
in the configure method.
I don't see the package names in your code .... but if "beans" are not in the 
package or child package of where teh app class is, it wont find it by default.

Mark

On Thu, Jan 7, 2021 at 10:02 AM Cox, Jeremy <jeremy....@progeny.net> wrote:

> Thank you all for the tips.  These are good improvements, but the 
> route still doesn't start.
>
> Adding to application.properties
>
> camel.springboot.main-run-controller = true
>
> prevents the program from shutting down, but the route still does not 
> start.
>
>
> I also added quartz dependency.  I verified that jars were added to 
> the final jar with the dependency.
>
>
> Sincerely,
>
> Jeremy Cox
> Software Engineer
> Universal Gateway at Progeny Systems
>
> Urgent contact: Text 859.322.3214
> Email    jeremy....@progeny.net
>
>
> -----Original Message-----
> From: Jared Whiklo [mailto:jwhi...@gmail.com]
> Sent: Thursday, January 7, 2021 9:36 AM
> To: users@camel.apache.org
> Subject: EXTERNAL: Re: Can't get routes to Start in SpringBoot / Camel
> 3.5.0
>
> External E-mail --- CAUTION: This email originated from outside 
> Progeny Systems. Do not click links or open attachments unless you 
> recognize the sender and know the content is safe.
>
> Hey Jeremy,
>
> I just did something similar and while I'm not done I've learned some 
> things.
>
> I would guess you need to add the application property defined here to 
> keep your routes running.
>
>
> https://camel.apache.org/camel-spring-boot/latest/index.html#_making_s
> ure_camel_context_is_running_in_standalone_spring_boot
>
> Cheers,
> Jared
>
> On Thu., Jan. 7, 2021, 08:09 Cox, Jeremy, <jeremy....@progeny.net> wrote:
>
> > I am trying to port a project from Spring/Camel 2  to Spring Boot / 
> > Camel 3.  The routes won't start.  I've tried everything I can think 
> > of/ find on google search.
> >
> > 1. I went to start.spring.io and generated a project template.  I 
> > commented out the dependencies I am not using yet: jpa, hibernate, etc.
> > 2. I added a test route.
> > 3. I compiled and ran program.
> > 4. My route did not start.
> >
> > I am not sure what is going on.  I have compared to code examples, 
> > and everything I have seems correct. I'm hoping I am missing 
> > something
> simple.
> > I'm also hoping for a sanity check -- should this be working?
> >
> > I have expanded on this basic start and got my hibernate and SQL 
> > databases to connect.  I just can't get the routes to start.
> >
> > I am developing using Redhat 7.6 / OpenJDK 11.  Also deploying 
> > Alpine
> > 3.10 with Java 11.  (OpenJDK, I presume)
> >
> > From program running on Redhat:
> >
> > 2021-01-07 09:00:42.326  INFO 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.5.0 (camel-1)
> is
> > starting
> > 2021-01-07 09:00:42.326 DEBUG 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Using
> > ClassResolver=org.apache.camel.impl.engine.DefaultClassResolver@6d07
> > a6
> > 3d,
> > PackageScanClassResolver=org.apache.camel.spring.boot.FatJarPackageS
> > ca
> > nClassResolver@571c5681,
> > ApplicationContextClassLoader=org.springframework.boot.loader.Launch
> > ed
> > URLClassLoader@21b8d17c,
> >
> RouteController=org.apache.camel.impl.engine.DefaultRouteController@48
> 8d1cd7
> > 2021-01-07 09:00:42.334  INFO 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : StreamCaching is not in use.
> If
> > using streams then its recommended to enable stream caching. See 
> > more details at http://camel.apache.org/stream-caching.html
> > 2021-01-07 09:00:42.334 DEBUG 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Using HeadersMapFactory:
> > org.apache.camel.impl.engine.DefaultHeadersMapFactory@7ceb3185
> > 2021-01-07 09:00:42.334 DEBUG 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Using ReactiveExecutor:
> > org.apache.camel.impl.engine.DefaultReactiveExecutor@436c81a3
> > 2021-01-07 09:00:42.334 DEBUG 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Using ThreadPoolFactory:
> > org.apache.camel.support.DefaultThreadPoolFactory@3561c410
> > 2021-01-07 09:00:42.334  INFO 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Using HealthCheck:
> camel-health
> > 2021-01-07 09:00:42.334 DEBUG 11442 --- [           main]
> > o.a.c.i.e.DefaultStreamCachingStrategy   : StreamCaching is not enabled
> > 2021-01-07 09:00:42.335  INFO 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Total 0 routes, of which 0 are
> > started
> > 2021-01-07 09:00:42.335  INFO 11442 --- [           main]
> > o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.5.0 (camel-1)
> > started in 0.009 seconds
> > 2021-01-07 09:00:42.336 DEBUG 11442 --- [           main]
> > o.a.camel.spring.SpringCamelContext      : start() took 54 millis
> >
> > I am not sure how to reference my code on a mailing list, so here goes.
> > application.properties is blank, per the template generation.
> >
> > --- pom.xml ---
> >
> > <?xml version="1.0" encoding="UTF-8"?> <project 
> > xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance";
> >         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > https://maven.apache.org/xsd/maven-4.0.0.xsd";>
> >         <modelVersion>4.0.0</modelVersion>
> >         <parent>
> >                 <groupId>org.springframework.boot</groupId>
> >                 <artifactId>spring-boot-starter-parent</artifactId>
> >                 <version>2.3.6.RELEASE</version>
> >                 <relativePath/> <!-- lookup parent from repository -->
> >         </parent>
> >         <groupId>net.sample.project</groupId>
> >         <artifactId>my-sample-project</artifactId>
> >         <version>0.0.1-SNAPSHOT</version>
> >         <name>my-sample-project</name>
> >         <description>SAMPLE</description>
> >
> >         <properties>
> >                 <java.version>11</java.version>
> >         </properties>
> >
> >         <dependencies>
> > <!--            <dependency>-->
> > <!--                    <groupId>org.springframework.boot</groupId>-->
> > <!--
> > <artifactId>spring-boot-starter-data-jpa</artifactId>-->
> > <!--            </dependency>-->
> >                 <dependency>
> >                         <groupId>org.springframework.boot</groupId>
> >
> > <artifactId>spring-boot-starter-security</artifactId>
> >                 </dependency>
> >                 <dependency>
> >                         
> > <groupId>org.apache.camel.springboot</groupId>
> >
>  <artifactId>camel-spring-boot-starter</artifactId>
> >                         <version>3.5.0</version>
> >                 </dependency>
> >
> > <!--            <dependency>-->
> > <!--                    <groupId>org.postgresql</groupId>-->
> > <!--                    <artifactId>postgresql</artifactId>-->
> > <!--                    <scope>runtime</scope>-->
> > <!--            </dependency>-->
> >                 <dependency>
> >                         <groupId>org.springframework.boot</groupId>
> >                         <artifactId>spring-boot-starter-test</artifactId>
> >                         <scope>test</scope>
> >                         <exclusions>
> >                                 <exclusion>
> >
> > <groupId>org.junit.vintage</groupId>
> >
> > <artifactId>junit-vintage-engine</artifactId>
> >                                 </exclusion>
> >                         </exclusions>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.springframework.security</groupId>
> >                         <artifactId>spring-security-test</artifactId>
> >                         <scope>test</scope>
> >                 </dependency>
> >         </dependencies>
> >
> >         <build>
> >                 <plugins>
> >                         <plugin>
> >
> > <groupId>org.springframework.boot</groupId>
> >
> > <artifactId>spring-boot-maven-plugin</artifactId>
> >                         </plugin>
> >                 </plugins>
> >         </build>
> >
> >         <repositories>
> >                 <repository>
> >                         <id>spring-milestones</id>
> >                         <name>Spring Milestones</name>
> >                         <url>https://repo.spring.io/milestone</url>
> >                 </repository>
> >                 <repository>
> >                         <id>spring-snapshots</id>
> >                         <name>Spring Snapshots</name>
> >                         <url>https://repo.spring.io/snapshot</url>
> >                         <snapshots>
> >                                 <enabled>true</enabled>
> >                         </snapshots>
> >                 </repository>
> >         </repositories>
> >         <pluginRepositories>
> >                 <pluginRepository>
> >                         <id>spring-milestones</id>
> >                         <name>Spring Milestones</name>
> >                         <url>https://repo.spring.io/milestone</url>
> >                 </pluginRepository>
> >                 <pluginRepository>
> >                         <id>spring-snapshots</id>
> >                         <name>Spring Snapshots</name>
> >                         <url>https://repo.spring.io/snapshot</url>
> >                         <snapshots>
> >                                 <enabled>true</enabled>
> >                         </snapshots>
> >                 </pluginRepository>
> >         </pluginRepositories>
> >
> > </project>
> >
> > --- DefaultRouteTest.java ---
> >
> > import org.apache.camel.CamelContext; import 
> > org.apache.camel.builder.RouteBuilder;
> > import org.springframework.beans.factory.annotation.Autowired;
> > import org.springframework.stereotype.Component;
> >
> > @Component
> > public class DefaultRouteTest extends RouteBuilder {
> >
> >     @Autowired
> >     CamelContext context;
> >
> >     @Override
> >     public void configure() throws Exception {
> >
> >
> from("quartz://myGroup/simpleAISFetchTimer1?cron=0+2,4,6,8,10,12,14,16
> ,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58+*+*+*+
> ?")
> >                 .to("log:testRoute");
> >     }
> > }
> >
> >
> >
> > Sincerely,
> >
> > Jeremy Cox
> > Software Engineer
> > Universal Gateway at Progeny Systems
> >
> > Urgent contact: Text 859.322.3214
> > Email    jeremy....@progeny.net
> >
> >
> >
>

Reply via email to