TimePicker problem: Getting undefined component type problem while running the project from command line

Community Driven Extensions Project
Post Reply
pvmuralik
Posts: 4
Joined: 04 Mar 2019, 13:05

04 Mar 2019, 13:13

Hi,

I am using pe timepicker component to input time in my project.

It runs fine when I try to run my project from Eclipse. But when I try to run the same thing from command line, I get "Undefined component type org.primefaces.extensions.component.TimePicker" May be I am doing some silly mistake. But couldn't figure it out on my own.

I am using;

Java 1.8
MyFaces 2.2.7
Jetty in Embedded mode
Primefaces 6.2
Primefaces Extensions 6.2.10
Primefaces Themes - Bootstrap - 1.0.10

regards,
Murali

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

04 Mar 2019, 14:58

Sounds like your command line is not including the PFE JAR file in the build. Are you using Maven? Can you paste your pom.xml here?

if you have built a WAR file did you unzip the WAR and make sure in the WEB-INF/lib folder the PFE Jar is there?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

pvmuralik
Posts: 4
Joined: 04 Mar 2019, 13:05

04 Mar 2019, 22:22

Here is my pom.xml.

Code: Select all

<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 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.mfore.jansms.solution.pes</groupId>
	<artifactId>jansmspes</artifactId>
	<packaging>jar</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>jansmspes</name>
	<url>http://maven.apache.org</url>
	<repositories>
		<repository>
			<id>clojars</id>
			<name>clojars</name>
			<url>http://clojars.org/repo/</url>
		</repository>
		<repository>
			<id>prime-repo</id>
			<name>PrimeFaces Maven Repository</name>
			<url>http://repository.primefaces.org</url>
			<layout>default</layout>
		</repository>
	</repositories>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jettyversion>9.3.0.M1</jettyversion>
		<timestamp>${maven.build.timestamp}</timestamp>
		<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
		<project.build.directory>target</project.build.directory>
		<resources.dir.compressed>${project.build.directory}/classes/META-INF/resources/primefaces-extensions</resources.dir.compressed>
		<resources.dir.uncompressed>${project.build.directory}/classes/META-INF/resources/primefaces-extensions-uncompressed</resources.dir.uncompressed>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.primefaces</groupId>
			<artifactId>primefaces</artifactId>
			<version>6.2</version>
		</dependency>
		<dependency>
			<groupId>org.primefaces.extensions</groupId>
			<artifactId>primefaces-extensions</artifactId>
			<version>6.2.10</version>
		</dependency>
		<dependency>
			<groupId>org.primefaces.themes</groupId>
			<artifactId>bootstrap</artifactId>
			<version>1.0.10</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>${jettyversion}</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20151123</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>2.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.4</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>2.2</version>
		</dependency>
		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>1.4</version>
		</dependency>
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>2.8.2</version>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>1.9</version>
		</dependency>
		<dependency>
			<groupId>org.apache.myfaces.core</groupId>
			<artifactId>myfaces-impl</artifactId>
			<version>2.2.7</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-webapp</artifactId>
			<version>9.3.0.M1</version>
		</dependency>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>el-api</artifactId>
			<version>2.2.1-b04</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>el-impl</artifactId>
			<version>2.2.1-b05</version>
		</dependency>
		<dependency>
			<groupId>javax.enterprise</groupId>
			<artifactId>cdi-api</artifactId>
			<version>1.2</version>
		</dependency>
		<dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
		</dependency>
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>jsr250-api</artifactId>
			<version>1.0</version>
		</dependency>
		<!-- <dependency> <groupId>com.mfore.jansms.utils</groupId> <artifactId>jansmsutils</artifactId> 
			<version>1.0-SNAPSHOT</version> </dependency> -->
		<dependency>
			<groupId>net.sf.uadetector</groupId>
			<artifactId>uadetector-resources</artifactId>
			<version>2014.10</version>
		</dependency>
		<dependency>
			<groupId>javax.enterprise</groupId>
			<artifactId>cdi-api</artifactId>
			<version>1.1</version>
		</dependency>
		<dependency>
			<groupId>com.itextpdf</groupId>
			<artifactId>itextpdf</artifactId>
			<version>5.5.0</version>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.40</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<!-- -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.shared</groupId>
						<artifactId>maven-filtering</artifactId>
						<version>3.1.1</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/webapp-resources/resources</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/src/main/webapp/resources</directory>
									<filtering>true</filtering>
									<includes>
										<include>**/*.css</include>
										<include>**/*.js</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-java-files</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>src/main/java</directory>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- Resource Plugin for primefaces extensions - Start -->
			<plugin>
				<groupId>org.primefaces.extensions</groupId>
				<artifactId>resources-optimizer-maven-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<useDataUri>true</useDataUri>
					<resourcesSets>
						<resourcesSet>
							<inputDir>${project.build.directory}/webapp-resources</inputDir>
						</resourcesSet>
					</resourcesSets>
				</configuration>
			</plugin>
			<!-- -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.12.4</version>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.9</version>
				<configuration>
					<sourceExcludes>
						<sourceExclude>**/.svn/**</sourceExclude>
					</sourceExcludes>
					<sourceIncludes>
						<sourceInclude>**/src/main/java/**</sourceInclude>
						<sourceInclude>**/src/main/webapp/**</sourceInclude>
					</sourceIncludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<finalName>${project.name}-${project.version}-${timestamp}</finalName>
					<excludes>
						<exclude>**/log4j2.xml</exclude>
					</excludes>
					<archive>
						<manifest>
							<!-- Jar file entry point -->
							<mainClass>com.mfore.jansms.solution.pes.StartServer</mainClass>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.5.3</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<manifest>
							<mainClass>com.mfore.jansms.solution.pes.StartServer</mainClass>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id> <!-- this is used for inheritance merges -->
						<phase>package</phase> <!-- bind to the packaging phase -->
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.5.3</version>
				<configuration>
					<descriptor>src/assembly/assemble.xml</descriptor>
					<finalName>${project.name}-${project.version}-${timestamp}</finalName>
				</configuration>
				<executions>
					<execution>
						<id>create-archive</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>appassembler-maven-plugin</artifactId>
				<version>1.1.1</version>
				<configuration>
					<assembleDirectory>target</assembleDirectory>
					<generateRepository>false</generateRepository>
					<programs>
						<program>
							<mainClass>com.mfore.jansms.solution.pes.StartServer</mainClass>
							<name>main</name>
						</program>
					</programs>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>assemble</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<directory>src/main/webapp</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
	</build>
</project>

I am using embedded jetty and building a jar file

Thanks for responding.

regards,
Murali

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

04 Mar 2019, 22:25

hmm. ok your pom.xml looks good.

can you explode you uberjar to verify it has everything it needs?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

pvmuralik
Posts: 4
Joined: 04 Mar 2019, 13:05

04 Mar 2019, 22:34

To my understanding it has all the needed things.

It has PE timepicker component.

And primefaces-extensions.taglib.xml is present under META-INF.

Should I check something else specifically?

regards,
Murali

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

04 Mar 2019, 22:39

I wonder if the problem is the way its making your uber jar is overriting th faces-config.xml from PrimeFaces or PFE. I am not quite sure how your Uber Jar is being bundled together.

But it feels like a file from one jar is overwriting the file of a later jar.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

pvmuralik
Posts: 4
Joined: 04 Mar 2019, 13:05

04 Mar 2019, 22:54

You are absolutely right. faces-config.xml of PF and PFE are not existing in my uber jar.

Any suggestions?

regards,
Murali

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

04 Mar 2019, 23:00

I think you have to fix your uber jar creation to allow them to be combined etc.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests