Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage #64

Open
vonavage opened this issue Nov 30, 2018 · 5 comments
Open

usage #64

vonavage opened this issue Nov 30, 2018 · 5 comments

Comments

@vonavage
Copy link

how to use the rfc5434 parser in a standalone app? it fails with slf4j error or missing class

@caffreyj
Copy link
Contributor

caffreyj commented Nov 30, 2018 via email

@vonavage
Copy link
Author

vonavage commented Nov 30, 2018

@caffreyj

I'm not sure how to invoke this... I tried as follows... using "Test" class in org.openmainframe.ade.ext.os.parser ... but, obviously will separate it out in package outside org.openmainframe.ade.ext.os.parser
`package org.openmainframe.ade.ext.os.parser;
//import org.openmainframe.ade.ext.os.parser.LinuxSyslog5424ParserBase;

public class Test
{
public static void main(String args[])
{
LinuxSyslog5424ParserBase ls5424pb = new LinuxSyslog5424ParserBase();

    String syslogWithNilPid = "<46>1 2014-05-30T08:52:40.620950-04:00 host-name rsyslogd - - - rsyslogd's groupid changed to 103";

    ls5424pb.parseLine(syslogWithNilPid);
}

}
`

I did "mvn clean package" and got the output as follows:-
INFO] Reactor Summary: [INFO] [INFO] ade ................................................ SUCCESS [ 0.191 s] [INFO] ade-core ........................................... SUCCESS [ 31.060 s] [INFO] ade-ext ............................................ SUCCESS [ 16.538 s] [INFO] ade-assembly ....................................... SUCCESS [ 1.945 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 49.845 s [INFO] Finished at: 2018-11-29T21:51:06-08:00 [INFO] Final Memory: 38M/666M [INFO] ------------------------------------------------------------------------

java -cp ./ade-ext/target/ade-ext-1.0.4.jar org.openmainframe.ade.ext.os.parser.Test

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.openmainframe.ade.ext.os.parser.LinuxSyslogLineParser.<clinit>(LinuxSyslogLineParser.java:45) at org.openmainframe.ade.ext.os.parser.Test.main(Test.java:8) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadCl

@vonavage
Copy link
Author

just to give the task that I'm trying is

  • parse a syslog file
  • store the output to a file or write to stdout
    -- it can be a json output or the object (which can be unpacked)

@caffreyj
Copy link
Contributor

caffreyj commented Dec 3, 2018

There are a set of jar files which the maven obtains when it builds an ADE image. You will probably need to include those jar file in the class path for your parse code. Here is a list of the jar which is used by ADE.
http://openmainframeproject.github.io/ade/open_source_used.html

@vonavage
Copy link
Author

vonavage commented Dec 5, 2018

Thank you.. will use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants