OpenSmpp / opensmpp

OpenSmpp - Java library implementing the SMPP protocol, and allowing development of External Short Message Entities (ESMEs) and more.
http://opensmpp.org/
Other
188 stars 170 forks source link

Not able to run Simulator main class #20

Closed partha006 closed 7 years ago

partha006 commented 7 years ago

Command mentioned in the javadoc of the Simulator class is

java -cp smpp.jar:smscsim.jar org.smpp.smscsim.Simulator

is not working and i also tried

java -cp D:\logica-smpp-sim-master\smscsim.jar;.;D:\logica-smpp-sim-master\smpp.jar org.smpp.smscsim.Simulator

The above command is also not working .

Kindly help me to start the simulator

ptomli commented 7 years ago

When reporting such issues it's greatly more helpful to describe what is happening, rather than behaviour you expect which is not happening. The phrase "is not working" doesn't describe anything terribly useful.

Anyhoo, you probably are missing some required JARs...

The below works for me, having downloaded the core, charset and sim artifacts from Maven Central.

java -cp opensmpp-core-3.0.1.jar:opensmpp-charset-3.0.1.jar:opensmpp-sim-3.0.1.jar org.smpp.smscsim.Simulator

partha006 commented 7 years ago

Thanks for quick response.

The below are the error I am getting when am running the command.

..\opensmpp-master>java -cp opensmpp-core-3.0.2.jar;opensmpp-charset-3.0.2.jar;opensmpp-sim-3.0.2.jar org.smpp.smscsim.Simulator Error: Could not find or load main class org.smpp.smscsim.Simulator

I am running in widow so i used ';' instead of ':'.I also tried ':' colon for that also am getting the same error.

The step I did was

I took a build using mvn clean install The build got success after that I try to run the main class using above command.

Is there any other step I missed?? I sure the code is working fine but I am missing something.

ptomli commented 7 years ago

Do the opensmpp-core-3.0.2.jar, opensmpp-charset-3.0.2.jar and opensmpp-sim-3.0.2.jar files exist in the directory you are running the command from? It looks to me like you're running this from the root of the GIT repository, and the build artifacts would have been in the module target/ directories. And they should be suffixed with -SNAPSHOT...

git clone https://github.com/OpenSmpp/opensmpp.git
cd opensmpp
mvn package
java -cp core/target/opensmpp-core-3.0.2-SNAPSHOT.jar:charset/target/opensmpp-charset-3.0.2-SNAPSHOT.jar:sim/target/opensmpp-sim-3.0.2-SNAPSHOT.jar org.smpp.smscsim.Simulator
partha006 commented 7 years ago

Thanks a lot.. The above solution worked for me. :)