samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommy Becker <tobec...@tivo.com>
Subject Re: SamzaException: no job factory class defined
Date Wed, 18 Mar 2015 16:42:19 GMT
Yes, Jetty was repackaged to org.eclipse.jetty in version 7.

On 03/18/2015 12:39 PM, Jordi Blasi Uribarri wrote:

That was it, and some more configurations that were missing:

task.class=samzafroga.job1
job.factory.class=org.apache.samza.job.local.ThreadJobFactory
job.name=samzafroga.job1
systems.kafka.producer.bootstrap.servers=broker01:9092

Now I am getting this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
        at org.apache.samza.coordinator.JobCoordinator$.apply(JobCoordinator.scala:56)
        at org.apache.samza.job.local.ThreadJobFactory.getJob(ThreadJobFactory.scala:39)
        at org.apache.samza.job.JobRunner.run(JobRunner.scala:62)
        at org.apache.samza.job.JobRunner$.main(JobRunner.scala:37)
        at org.apache.samza.job.JobRunner.main(JobRunner.scala)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
        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:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

What I don’t understand is that the jetty jar is included in the job. Could it be a version
problem? I am using jetty-util-6.1.26.jar.

Thanks,

        Jordi

-----Mensaje original-----
De: Roger Hoover [mailto:roger.hoover@gmail.com]
Enviado el: miércoles, 18 de marzo de 2015 16:52
Para: dev@samza.apache.org<mailto:dev@samza.apache.org>
Asunto: Re: SamzaException: no job factory class defined

Hi Jordi,

I think you need to add the "job.factory.class" property.
http://samza.apache.org/learn/documentation/0.8/jobs/configuration-table.html

#An example
job.factory.class=org.apache.samza.job.local.ThreadJobFactory

Cheers,

Roger

On Wed, Mar 18, 2015 at 8:45 AM, Jordi Blasi Uribarri <jblasi@nextel.es><mailto:jblasi@nextel.es>
wrote:



Hello,

I am trying to run my first job (publish what receives) in Samza and I
think that all the dependencies where added by configuring the Maven
repositories (solved in a recent question to the list). I am getting
another exception on the Job runner:

#/opt/jobs# bin/run-job.sh
--config-factory=org.apache.samza.config.factories.PropertiesConfigFac
tory --config-path=file://$PWD/job1.properties
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-2) OpenJDK
64-Bit Server VM (build 24.75-b04, mixed mode)
/usr/lib/jvm/java-7-openjdk-amd64/bin/java
-Dlog4j.configuration=file:bin/log4j-console.xml
-Dsamza.log.dir=/opt/jobs -Djava.io.tmpdir=/opt/jobs/tmp -Xmx768M
-XX:+PrintGCDateStamps -Xloggc:/opt/jobs/gc.log
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10
-XX:GCLogFileSize=10241024 -d64 -cp
/opt/hadoop/conf:/opt/jobs/lib/samzafroga-0.0.1-SNAPSHOT.jar:/opt/jobs
/lib/samzafroga-0.0.1-SNAPSHOT-jar-with-dependencies.jar
org.apache.samza.job.JobRunner
--config-factory=org.apache.samza.config.factories.PropertiesConfigFac
tory --config-path=file:///opt/jobs/job1.properties
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Level value for root is  [INFO].
log4j: root level set to INFO
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{dd MMM yyyy
HH:mm:ss} %5p %c{1} - %m%n].
log4j: Adding appender named [consoleAppender] to category [root].
log4j: Class name: [org.apache.log4j.RollingFileAppender]
log4j: Setting property [append] to [false].
log4j: Setting property [file] to [out/learning.log].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p
[%c{1}] %m%n].
log4j: setFile called: out/learning.log, false
log4j: setFile ended
log4j: Adding appender named [fileAppender] to category [root].
Exception in thread "main" org.apache.samza.SamzaException: no job
factory class defined
        at org.apache.samza.job.JobRunner.run(JobRunner.scala:53)
        at org.apache.samza.job.JobRunner$.main(JobRunner.scala:37)
        at org.apache.samza.job.JobRunner.main(JobRunner.scala)

My properties file is  this:
task.class=samzafroga.job1

systems.kafka.samza.factory=org.apache.samza.system.kafka.KafkaSystemF
actory

systems.kafka.consumer.zookeeper.connect=acio-broker01:2181,acio-broke
r02:2181
task.inputs=kafka.frogain

serializers.registry.json.class=org.apache.samza.serializers.JsonSerde
Factory systems.kafka.streams.frogain.samza.msg.serde=json

This is the code job code:

package samzafroga;

import org.apache.samza.config.Config; import
org.apache.samza.system.IncomingMessageEnvelope;
import org.apache.samza.system.OutgoingMessageEnvelope;
import org.apache.samza.system.SystemStream;
import org.apache.samza.task.MessageCollector;
import org.apache.samza.task.StreamTask; import
org.apache.samza.task.TaskContext;
import org.apache.samza.task.TaskCoordinator;

public class job1 implements StreamTask {
                private final SystemStream OUTPUT_STREAM = new
SystemStream("kafka", "beste");

                public void process(IncomingMessageEnvelope envelope,
MessageCollector collector, TaskCoordinator coordinator)
                {
                               String msg = (String)envelope.getMessage();
                               String outmsg = msg;
                               collector.send(new
OutgoingMessageEnvelope(OUTPUT_STREAM, outmsg));
                }
}

I have been trying to read the code in the file JobRunner.scala, that
apparently is the one generation the exception and as I understand is
having a problem . I am not really sure if the problem is with the
task.class definition or I still have something missing in the system.

Thanks in advance,

                Jordi
________________________________
Jordi Blasi Uribarri
Área I+D+i

jblasi@nextel.es<mailto:jblasi@nextel.es>
Oficina Bilbao

[http://www.nextel.es/wp-content/uploads/Firma_Nextel_2014.png]



--
Tommy Becker
Senior Software Engineer

Digitalsmiths
A TiVo Company

www.digitalsmiths.com<http://www.digitalsmiths.com>
tobecker@tivo.com<mailto:tobecker@tivo.com>

________________________________

This email and any attachments may contain confidential and privileged material for the sole
use of the intended recipient. Any review, copying, or distribution of this email (or any
attachments) by others is prohibited. If you are not the intended recipient, please contact
the sender immediately and permanently delete this email and any attachments. No employee
or agent of TiVo Inc. is authorized to conclude any binding agreement on behalf of TiVo Inc.
by email. Binding agreements with TiVo Inc. may only be made by a signed written agreement.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message