I am trying to operate LED which is connected to Raspberry Pi form my web browser. for this i am using Pi4j and vaadin framework for UI. i have deployed WAR file of my project in tomcat server which is running on Raspberry Pi. when i run the url on my browser I am getting the following error
HTTP Status 500 - java.lang.RuntimeException: Unable to open GPIO export interface: Permission denied
type Exception report
message java.lang.RuntimeException: Unable to open GPIO export interface: Permission denied
description The server encountered an internal error (java.lang.RuntimeException: Unable to open GPIO export interface: Permission denied ) that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.RuntimeException: Unable to open GPIO export interface: Permission denied
com.vaadin.server.VaadinServlet.handleServiceException(VaadinServlet.java:580)
com.vaadin.server.VaadinServlet.service(VaadinServlet.java:343)
com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.RuntimeException: Unable to open GPIO export interface: Permission denied
com.pi4j.wiringpi.GpioUtil.export(Native Method)
com.pi4j.io.gpio.RaspiGpioProvider.export(RaspiGpioProvider.java:67)
com.pi4j.io.gpio.impl.GpioPinImpl.export(GpioPinImpl.java:165)
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionPin(GpioControllerImpl.java:520)
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:645)
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:672)
com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:684)
com.example.raspberrypigpioexample01.Raspberrypigpioexample01UI.init(Raspberrypigpioexample01UI.java:19)
com.vaadin.ui.UI.doInit(UI.java:529)
com.vaadin.server.AbstractCommunicationManager.getBrowserDetailsUI(AbstractCommunicationManager.java:2468)
com.vaadin.server.AbstractCommunicationManager.handleBrowserDetailsRequest(AbstractCommunicationManager.java:2362)
com.vaadin.server.VaadinServlet.service(VaadinServlet.java:325)
com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.28 logs.