Project

General

Profile

Help RHEL rpm build.

Slava Bendersky
Added over 5 years ago

Hello Everyone,

I am trying build rpm for RHEL 6.4 and getting the following error. It seem related to certs.

Any suggestion thank you in advance.

I pulled SVN trunk 3003.

    jar-file:
    [javac] Compiling 381 source files to /tmp/classes
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/net/IOService.java:45: package tigase.cert does not exist
    [javac] import tigase.cert.CertCheckResult;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/TLSWrapper.java:27: package tigase.cert does not exist
    [javac] import tigase.cert.CertCheckResult;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/TLSWrapper.java:28: package tigase.cert does not exist
    [javac] import tigase.cert.CertificateUtil;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/TLSWrapper.java:143: cannot find symbol
    [javac] symbol : class CertCheckResult
    [javac] location: class tigase.io.TLSWrapper
    [javac] public CertCheckResult getCertificateStatus(boolean revocationEnabled) {
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:56: package tigase.cert does not exist
    [javac] import tigase.cert.CertificateEntry;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:57: package tigase.cert does not exist
    [javac] import tigase.cert.CertificateUtil;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:193: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] private KeyManagerFactory addCertificateEntry(CertificateEntry entry, String alias, boolean store)
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:26: package tigase.cert does not exist
    [javac] import tigase.cert.CertCheckResult;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/net/IOService.java:431: cannot find symbol
    [javac] symbol : class CertCheckResult
    [javac] location: class tigase.net.IOService<RefObject>
    [javac] CertCheckResult certCheckResult = wrapper.getCertificateStatus(false);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/TLSWrapper.java:152: cannot find symbol
    [javac] symbol : variable CertCheckResult
    [javac] location: class tigase.io.TLSWrapper
    [javac] return CertCheckResult.none;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/TLSWrapper.java:156: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.TLSWrapper
    [javac] return CertificateUtil.validateCertificate(peerChain, TLSUtil.getTrustStore(),
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/TLSWrapper.java:162: cannot find symbol
    [javac] symbol : variable CertCheckResult
    [javac] location: class tigase.io.TLSWrapper
    [javac] return CertCheckResult.invalid;
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:206: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateUtil.storeCertificate(new File(certsDirs[0], alias + ".pem").toString(), entry);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:233: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry entry = CertificateUtil.parseCertificate(new CharArrayReader(pemCert.toCharArray()));
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:233: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry entry = CertificateUtil.parseCertificate(new CharArrayReader(pemCert.toCharArray()));
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:296: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] KeyPair keyPair = CertificateUtil.createKeyPair(1024, "secret");
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:297: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] X509Certificate cert = CertificateUtil.createSelfSignedCertificate(email, alias, ou, o, null, null, null,
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:299: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry entry = new CertificateEntry();
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:299: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry entry = new CertificateEntry();
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:361: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry certEntry = CertificateUtil.loadCertificate(entry.getValue());
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:361: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry certEntry = CertificateUtil.loadCertificate(entry.getValue());
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:377: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry certEntry = CertificateUtil.loadCertificate(file);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:377: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry certEntry = CertificateUtil.loadCertificate(file);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:451: cannot find symbol
    [javac] symbol : class CertificateEntry
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry certEntry = CertificateUtil.loadCertificate(file);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:451: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] CertificateEntry certEntry = CertificateUtil.loadCertificate(file);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:481: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] KeyPair keyPair = CertificateUtil.createKeyPair(1024, "secret");
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/io/SSLContextContainer.java:482: cannot find symbol
    [javac] symbol : variable CertificateUtil
    [javac] location: class tigase.io.SSLContextContainer
    [javac] X509Certificate cert = CertificateUtil.createSelfSignedCertificate("fake_local@tigase", "fake one", "none",
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:133: cannot find symbol
    [javac] symbol : class CertCheckResult
    [javac] location: class tigase.server.xmppserver.proc.Dialback
    [javac] CertCheckResult certCheckResult =
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:134: cannot find symbol
    [javac] symbol : class CertCheckResult
    [javac] location: class tigase.server.xmppserver.proc.Dialback
    [javac] (CertCheckResult) serv.getSessionData().get(S2SIOService.CERT_CHECK_RESULT);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:160: cannot find symbol
    [javac] symbol : variable CertCheckResult
    [javac] location: class tigase.server.xmppserver.proc.Dialback
    [javac] if ((certCheckResult == CertCheckResult.trusted)
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:233: cannot find symbol
    [javac] symbol : class CertCheckResult
    [javac] location: class tigase.server.xmppserver.proc.Dialback
    [javac] CertCheckResult certCheckResult =
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:234: cannot find symbol
    [javac] symbol : class CertCheckResult
    [javac] location: class tigase.server.xmppserver.proc.Dialback
    [javac] (CertCheckResult) serv.getSessionData().get(S2SIOService.CERT_CHECK_RESULT);
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/server/xmppserver/proc/Dialback.java:236: cannot find symbol
    [javac] symbol : variable CertCheckResult
    [javac] location: class tigase.server.xmppserver.proc.Dialback
    [javac] if (certCheckResult == CertCheckResult.trusted) {
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/vhosts/VHostJDBCRepository.java:241: cannot find symbol
    [javac] symbol : method getDnsResultHost()
    [javac] location: class tigase.util.DNSEntry
    [javac] || def_srv_address.equals(dnsEntry.getDnsResultHost())) {
    [javac] ^
    [javac] /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/src/main/java/tigase/vhosts/VHostJDBCRepository.java:244: cannot find symbol
    [javac] symbol : method getDnsResultHost()
    [javac] location: class tigase.util.DNSEntry
    [javac] return "Incorrect DNS SRV settings ('" + dnsEntry.getDnsResultHost() + "', '"
    [javac] ^
    [javac] 35 errors

    BUILD FAILED
    /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/build.xml:32: The following error occurred while executing this line:
    /home/volga629/rpmbuild/BUILD/tigase-server-5.1.5/ant-definitions.xml:16: Compile failed; see the compiler error output for details.


Replies (23)

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Do not use Svn repository. It contains old source codes. Please use git repository as described on the project tracking system: https://projects.tigase.org/projects/tigase-pubsub/repository The same applies to the main server source code and other components. SVN is left only for backward compatibility for users who use older versions.

The SSL certificate we use is from StarCom which might not be recognized by your git. We are working on resolving the problem. In the meantime you have to turn ignoring SSL warnings on unfortunately.

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Ups, I am sorry I misread your post. As for the outdated Svn repository and suggestion to use git instead I was correct. But please forget the explanation about SSL certificate.

How do you compile the tigase code? Please use maven as it automatically resolves all dependencies so you do not have to worry about compiling all packages in order.

(1)

Added by Slava Bendersky over 5 years ago

Hello Artur,

The initial build should be done through ant

build-jar-repository -p libs tigase-utils tigase-xmltools
ls -l libs/
ant -Dbuild-no=3003 jar-dist docs

There RHEL patch whic insert into build.xml trunk number.

   <property name="version" value="${ver}-b${build-no}"/>
   <property name="dist" value="dist/${projectname}-${jarfile}-${version}"/>
  </target>

(1)

Added by Slava Bendersky over 5 years ago

Tried pull get error

[volga629@testmailsrv01 ~]$ git clone https://repository.tigase.org/git/tigase-server.git

Initialized empty Git repository in /home/volga629/tigase-server/.git/

error: while accessing https://repository.tigase.org/git/tigase-server.git/info/refs

fatal: HTTP request failed

Tried set http.sslVerify "false"

(1)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

setting git config http.sslVerify false should work.

as for the building - why are you using ANT? We provide and recommend using maven as it handles dependencies on it's own. Nevertheless, from your post it seems that you are only using tigase-xmltools and xml-utils to build tigase, I'm not sure which versions but there may be problem with missing classes. Also, for the version of pubsub in svn repository you should provide depencencies in following versions:

  • tigase-server:5.1.0

  • tigase-utils:3.3.11

  • tigase-xmltools:3.3.6

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Try:

GIT_SSL_NO_VERIFY=true git clone http://repository.tigase.org/git/tigase-server.git

Apparently git config works only after you already have a repository locally.

(1)

Added by Slava Bendersky over 5 years ago

Hello Everyone.

I was using ant, because it was set in SRPM spec file.

[volga629@testmailsrv01 SOURCES]$ GIT_SSL_NO_VERIFY=true git clone http://repository.tigase.org/git/tigase-server.git
Initialized empty Git repository in /home/volga629/rpmbuild/SOURCES/tigase-server/.git/
fatal: http://repository.tigase.org/git/tigase-server.git/info/refs not found: did you run git update-server-info on the server?

(1)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

please try using https: instead of http: in your url

Added by Slava Bendersky over 5 years ago

Hello Everyone,

I pulled last git. https did the trick.

(1)

Added by Slava Bendersky about 5 years ago

I pulled GIT. What will be last GIT build ?

Currently rpm is building with ant -Dbuild-no=3003 jar-dist docs

What is recommended way to build it ?

(1)

Added by Wojciech Kapcia TigaseTeam about 5 years ago

I was using ant, because it was set in SRPM spec file.

Which file is it exactly? Where did you obtain it?

I guess that your intention is to build rpm package, but we do not provide at the moment any scripts to do that. If you are using external tool and only want to get tigase binaries build then, once again - we recommend using maven for building it. Bottomline - please explain in detail your desired outcome and action you've taken so we could assist you better.

(1)

Added by Slava Bendersky about 5 years ago

Hello Everyone,

Finally I got rpms built correctly. They according to RHEL system.

Updated some configuration and last part left is some issue with SSL which seem only configuration matter.

Will be nice if some body from tigase team can install on RHEL and test it, in term of tigase configuration.

As side note tigase rpm have requirements for this repo

[jpackage-generic-devel]
name=JPackage Generic Developer
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/devel/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
[jpackage-generic-free]
name=JPackage generic free
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/free/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc

2013-11-27 22:54:08.356 [main]             SSLContextContainer.init()         WARNING:  There was a problem initializing SSL certificates.
java.lang.NullPointerException
    at tigase.io.SSLContextContainer.init(SSLContextContainer.java:403)
    at tigase.io.TLSUtil.configureSSLContext(TLSUtil.java:89)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:815)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:550)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:182)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:115)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:141)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:696)
    at tigase.server.XMPPServer.start(XMPPServer.java:152)
    at tigase.server.XMPPServer.main(XMPPServer.java:121)
Jid vhost-manager;

[volga629@cadevsrv01 tigase]$ cd ~/rpmbuild/RPMS/noarch/
[volga629@cadevsrv01 noarch]$ ls -la
total 22356
drwxr-xr-x. 2 volga629 volga629     4096 Nov 27 17:24 .
drwxrwxr-x. 5 volga629 volga629     4096 Oct  4 21:23 ..
-rw-rw-r--  1 volga629 volga629  2484240 Nov 27 17:24 tigase-server-5.2.1-3.el6.noarch.rpm
-rw-rw-r--  1 volga629 volga629  1139868 Nov 27 17:24 tigase-server-javadoc-5.2.1-3.el6.noarch.rpm

(1)

Added by Wojciech Kapcia TigaseTeam about 5 years ago

Could you provide a patch file which would include all scripts/cofigurations necessary for generating RPM package and/or rpm files for testing?

(1)

Added by Slava Bendersky about 5 years ago

I fixed init script for RHEL based on tigase.sh. JAVA_HOME will be set in tigase.conf when yum installs rpm.

You can grab source rpm here it include all what is need it:

ftp://ftpsrv01.networklab.ca/centos/6/SRPM/

RPM you can grab right here.

ftp://ftpsrv01.networklab.ca/centos/6/RPMS/noarch/

(1)

Added by Slava Bendersky about 5 years ago

Forgot spec file fixed too.

(1)

Added by Slava Bendersky about 5 years ago

The only one think which I can't find.

 SimpleCache.<init>()               WARNING:  Tigase cache turned off.
(1)

Added by Slava Bendersky about 5 years ago

How I can use SSL for LDAP authentication ?

Can't find any info.

ldaps://my.ldap:636
(1)

Added by Slava Bendersky about 5 years ago

Please use last rpms, I added java repo into specs file that on installation it will use last dependency for tigase-server.

(1)

Added by Wojciech Kapcia TigaseTeam about 5 years ago

OK, let's start from the beginning. You're written:

I am trying build rpm for RHEL 6.4

How are you trying to do that? Using some kind of script I presume? I was asking for a patch file to our repository repository including all changes you've made (to config files as well as aforementioned script - yes, in a patch) which we could run and generate rpm files for testing purposes on our own and subsequently include it in the repository.

As for the SimpleCache entry from the logs - what's wrong with it?

Added by Slava Bendersky about 5 years ago

To build proper rpm. I am using rpmbuild. For this you need build rpm structure with non root user.

Please follow this link http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment.

Then you need download SRPM from repository and install it with non root user where RPM structure installed.

rpm -ihv ftp://ftpsrv01.networklab.ca/centos/6/SRPM/tigase-server-5.2.1-4.el6.src.rpm

By doing that it will put all files from source rpm in proper places. Example: spec file will go to rpmbuild/SPECS and so..

Also you will need install all dependencies with to build rpm. Those dependencies assigned to RPM with BuildRequires: in spec file.

I didn't put yet maven in specs, but you will need build maven like this.

cd /opt

wget ~~O ~~ "http://apache.petsads.us/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz" | tar ~~xzf ~~

ln -sf /opt/apache-maven-3.0.5/bin/mvn /usr/bin/mvn

Also you will need java repo which a posted earlier. There last rpm for java.

To build rpm you will need adjust specs file and use rpmbuild -ba --sign (gpg signature) tigase-server.spec

(1)

Added by Wojciech Kapcia TigaseTeam about 5 years ago

Slava Bendersky wrote:

Then you need download SRPM from repository and install it with non root user where RPM structure installed.

rpm -ihv ftp://ftpsrv01.networklab.ca/centos/6/SRPM/tigase-server-5.2.1-4.el6.src.rpm

First of all - file can't be downloaded, for some reasons it gives me error Couldn't resolve the host. Second thing - we still miss building SRPM package thus missing whole chain to generate the final rpm without external srpm files.

(1)

Added by Slava Bendersky about 5 years ago

Please try use wget download locally and then rpm to install.

Or try use IP

Name: ftpsrv01.networklab.ca

Address: 76.10.157.135

Also I can help setup all environment to build RPM, based on my source rpm. We can do remote session like TeamVeiwer that you can see what I am doing.

Another way get SRPM

  1. yum install yum-utils

  2. Grab my repo file ftp://ftpsrv01.networklab.ca/centos/6/RPMS/x86_64/networklab.repo

  3. yum clean all

  4. yumdownloader --source tigase-server

  5. Non root user where installed RPM build environment. rpm -ihv tigase-server*

You can build you source rpm, but then you need do everything from scratch. I think the best way get source rpm installed with all environments and then just delivery tar or patch to SOURCE dir and then delivery new patches and tar through existing specs file. Also -ba for rpmbuild will build and create all rpms and srpm. Each time when you delivery new patch or tar you will have new srpm with all update in it.

(1)

Added by Wojciech Kapcia TigaseTeam about 5 years ago

For the sake of this thread I've created a ticket regarding building RPM package - #1657

    (1-23/23)