Flex blazeds/lcds AMF serialization for transient variables
I am using LCDS and Flex. When I am sending an object from java to Flex, I donot want to send all the properties. As far as I know, if you do not want to serialize make a variable transient.
eg.
private transient Date birthDate;
public Date getBirthDate(){
return birthDate;
public void setBirthDate(Date val){
birthDate = val;
//Some code here.
Now the serialized object should not have birthDate in it. But When I see the AMF logs , the object has the birthDate with value in it.
Does serialization looks into code and checks the private variable is transient.( I don't understand how it has access to private property. I am little confused.)
Should I mark variable as public. Then getters and setters make no sense and moreover I write some code in setter method. So I need setter.
Questions:
I read in a book(Enterprise flex with blazeds by Brain Telintelo, Chapter 15) that out of box Blazeds only serializes fileds that have matching getters and setters. If this is the case, will blazeds even bothers to check private property as transient.
Can some body please explain how normal serializtion( not amf serializtion ) takes place and keeps track of private transient variables even though they have public getters and setters.
How do I make a java variable not serialize in Flex/LCDS/BlazeDS environment.
I have 50-60 variables in objects and 4 or 5 varibales should not be seriablezed. So writing custion Serializer in such a large objects is a big pain. And another disadvantage I see is hibernate will not be able to use this object if I write my own serializer.
Martin
Is it possible to post your findings as well ?
I'm encountering the same concerns with AMF and could use some help.
Ideally, can you assist with the following:
1. convert actionscript object graph to amf bytearray
2. convert amf bytearray to actionscript object graph
3. convert java object graph to amf bytearray
4. convert amf byte array to java object graph
Thanks,
-Jonathan
Similar Messages
-
How can we have transient variable value as a parameter for an attribute?
Hi,
I am using JDev 11.1.1.2 with ADF11g.
I have a requirement where I have to display a table with many columns. One of the columns is a drop down whose values are fetched from DB. This is a non-DB item and so becomes a transient variable of the VO.
There is another column/attribute of the VO that has to first pick the value of the transient variable and display values in the LOV.
How can this be achieved? Do we have an example link for this?Hi simanta,
According to your description that you are experiencing the issue with passing one textbox's values as parameter to another textbox, you got some errors, right?
I have tested on my local environment and can reproduce your issue, your issue can be caused by the invalid expression you have added in the parameter for textbox1, you have mentioned that the textbox1 have just one value, for example, if you specify
the default value and available value using this expression "=first(Fields!Yourfields.Value, "DataSet2")" you will get this kind of error.
So, I suggest you not using the expression in the parameter, you can add condition in the query to get the proper value for textbox1, you said you also try to create an dataset for textbox1 but not getting the proper values of textbox1, please reference
to details information below to check if you have done the right actions:
Create an Dataset(Dateset2) to get the value for textbox1:
I suppose you want to get the first values from the table, you can use query below instead of the using expression:
Select Top 1 amount from tablename2
Add the parameter(Param1) for textbox1, specify both the available values and default values by select the "Get values from a query" (DataSet2)
In the main dataset(Dataset1), add the filter like below to display the textbox2's values which are greater than Textbox1:
You can also filter the data by modify the query of Dataset1:
SELECT * FROM TableName1
where SalesAmount >(@Param1)
If you problem still exists, please try to provide information below to help us more effective to provide an solution:
How did you get the value for textbox1(Please provide all the expressions or the dataset query you are currently using)
How did you add the filter to filter the Textbox2 which greater than textbox1?
Any problem, please free to ask.
Regards
Vicky Liu -
Local BlazeDS acting as proxy for remote LCDS/BlazeDS using remoting service
Hi,
We are developing a product in Adobe AIR. We are considering BlazeDS/LCDS for the backend.
At client locations, one or more machines on which the product is installed may not have access to internet. I am wondering if we can point the client application to a local BlazeDS which can act as a proxy for a remote BlazeDS.
Especially, what if we use Remoting, instead of HTTPService or Web Service.
What about publish/subscribe messaging?
Thanks in advance,
Tanmay DalviHi,
We are developing a product in Adobe AIR. We are considering BlazeDS/LCDS for the backend.
At client locations, one or more machines on which the product is installed may not have access to internet. I am wondering if we can point the client application to a local BlazeDS which can act as a proxy for a remote BlazeDS.
Especially, what if we use Remoting, instead of HTTPService or Web Service.
What about publish/subscribe messaging?
Thanks in advance,
Tanmay Dalvi -
DTD for BlazeDS/LCDS config files
Is there any DTD available for BlazeDS/LCDS config files?
ThanksThanks a bunch, that was it. Any ideas where I can find DTSs
or Schemas for the FDS config files?
-Robert -
Value not displaying for the transient variable
Hi all,
I have added a transient variable in my VO.xml file and assigning a value to it in my code along with other non-transient variables. But that value is not getting displayed on the UI.
Please help me in understanding the behavior of the transient variables in this context and how will I be able to see that value on the UI.
Thanks.
Gurpreet Singhhi Gurpreet,
You can add values to that transient column programatically,either by getiing the row from the iterator and then row.setAttribute('Column_name','Value');
Or providing value to it in the SQL... -
Revision: 22429
Revision: 22429
Author: [email protected]
Date: 2011-09-07 08:04:46 -0700 (Wed, 07 Sep 2011)
Log Message:
Adding the default fallback of serializer and deserializer classes to amf deserializer and amf serializer
Modified Paths:
blazeds/trunk/modules/core/src/flex/messaging/io/SerializationContext.java -
Problem in RPC call (flex,blazeds,spring,H2,tomcat,eclipse)
Hi, I've problem displaying value from backend onto the flex UI. I'm using Flex,BlazeDS, Spring, H2 in my applicaiton (testdrive app).
I've basically added another flex project to the testdrive app i downloaded. everything is working fine except the intended rpc invoke.
pls find the code snippets for the related change below :
1. FlexHelloWorld.mxml
private function resultHandler(event:ResultEvent):void
//used for debugging - shows details about result
//returned by the Java class method
Alert.show("success... in flex");
Alert.show( ObjectUtil.toString(event.result) );
<mx:RemoteObject id="ro" destination="helloServiceDestination" result="resultHandler(event)" fault="faultHandler(event)"/>
<mx:Panel x="25" y="10" width="653" height="407" layout="vertical" title="Test Flex 3 Using Java" borderColor="#008040" fontFamily="Arial" fontWeight="bold" fontSize="13">
<mx:Text text="Click The Button To Test Getting Data Into Flex From A Java Class" fontWeight="bold" width="250"/>
<mx:Button label="Get Hello World Mesg From Java!" click="ro.getHelloWorld()"/>
</mx:Panel>
2. remoting-config.xml in flex
<destination id="helloServiceDestination" channels="my-amf">
<properties>
<source>org.springframework.flex.samples.example.HelloWorld</source>
</properties>
</destination>
3. flex-servlet.xml in spring
<flex:remoting-destination ref="helloServiceDestination" />
4. app-config.xml in spring
<bean id="helloServiceDestination" class="org.springframework.flex.samples.example.HelloWorld">
</bean>
5. HelloWorld.java
package org.springframework.flex.samples.example;
* TODO Document HelloWorld
* <p />
* @author Vinod.Jayakumar
public class HelloWorld {
public String getHelloWorld(){
return "HelloFromJava";
expected result : http://localhost:1977/testdrive/FlexHelloWorld.html on click of button in the screen a alert message "HelloFromJava" should be shown but i get the following error message :
(mx.rpc::Fault)#0
content = (null)
errorID = 0
faultCode = "InvokeFailed"
faultDetail = "Couldn't establish a connection to 'helloServiceDestination'"
faultString = "[MessagingError message='Destination 'helloServiceDestination' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']"
message = "faultCode:InvokeFailed faultString:'[MessagingError message='Destination 'helloServiceDestination' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']' faultDetail:'Couldn't establish a connection to 'helloServiceDestination''"
name = "Error"
rootCause = (null)
Request you all to provide your valuable inputs. I know there's really something silly which has gone wrongHi jvk180:
Firstly, you should either need to define the destination in remoting-config.xml or in app-context.xml, but and in both places.
Secondly, the error indicates that it is missing the channel information.
Option 1:
Assuming your bean "helloServiceDestination" uses other Spring beans, then:
1. The right place to declare the destinations is in app-context.xml.
2. In that case, you need to also define the channels that the destination will be exposed over. See documentation for how to do that.
3. In your remote object declaration, you need to pass the channel set that gets used as well.
<mx:ChannelSet id="cs">
<mx:AMFChannel url="http://<yourServerName>:<yourServerPort>:/<yourContextRoot>/messagebroker/amf"/>
</mx:ChannelSet>
<mx:RemoteObject id="ro" destination="helloServiceDestination" channelset="{cs}" result="resultHandler(event)" fault="faultHandler(event)"/>
Option 2:
If you declare your destination, in remoting-config.xml, then you need to compile your swf with services-config.xml. Refer to documentation for how to do that.
Hope that helps.
Rohit -
Import BlazeDS/LCDS Service
I have BlazeDS turnkey 3 running happily on my Mac.
I followed the instructions to unzip the samples source files then create new projects using these sources OK.
As an example I have created a project using the testdrive-webservice sample.
When trying to 'Connect to Data/Service' > 'BlazeDS' service type an authentication dialog appears asking for RDS/Administrator username etc.
I cannot find any reference to this, and when trying any user pass combination or checking the 'No password required' box no error is produced until you proceed to the next step. Which is 'New Flex Service' dialog, 'Import BlazeDS/LCDS Service' dialog which has 'connection refused' at the top.
The only way I have found of resetting this problem is by re-starting Flash Builder.
Any ideas?
A copy of the java exception is attached.After installing BlazeDS 4.x pls remember to uncomment the following lines in <blazeds-home>\tomcat\webapps\blazeds\WEB-INF\web.xml:
<!-- begin rds
<servlet>
<servlet-name>RDSDispatchServlet</servlet-name>
<display-name>RDSDispatchServlet</display-name>
<servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
<init-param>
<param-name>useAppserverSecurity</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
<servlet-mapping id="RDS_DISPATCH_MAPPING">
<servlet-name>RDSDispatchServlet</servlet-name>
<url-pattern>/CFIDE/main/ide.cfm</url-pattern>
</servlet-mapping>
end rds -->
Since you are installing the turnkey build, I believe you would not have any authentication setup, so would have to change the highlighted tags value to false.
<param-value>false</param-value>
The RDSDispatchServlet allows Flash Builder to introspect the RemoteObjects deployed in your blazeds server hence it is kept commented by default in the web.xml. Its a small setup step required in the turnkey bundle in the interest of security.
-mayank -
I have a class which implements Serializable
and I was wondering if there was anything
I could do to speed up transfering this class
from Server to Client. The class contains
two String variables which are set on the server
and then passed to the client. Would it make
sense to make them transient or would I then
loose their values when they get passed to the
server?You would lose the value when your object is serialized.
If you want to optimize the serialized data, you can implement writeObject() and readObject() -- see the documentation for java.lang.Serializable for more details. -
How to populate an EO Transient variable used in Conditional expression.
Hi All
I have a Unique Key Validator which has Conditional Execution in which I am checking for the value of transient variable and based on that value this validator is invoked.
Problem is :- When this Conditional expression is processed, transient variable is not populated (code to populate it is written in getter method). As a result of which, I am not getting expected results.
This is my conditional expression :- source.<Transient_variable> = <some value>
I tried by replacing this expression as :- adf.object.getterMethod = <some value> , but that gave me the prototype not found error (method is present in EOImpl.java).
How can I populate this transient variable before it is evaluated in conditional expression???
Suggestions are welcomed!!!
Thanks
NitinJust to explain
Both adf.object.methodName and source.methodName are used to access EntityImpl methods. Difference is
adf.object.methodName - used while defaulting the values of attributes
source.methodName - used in validation expression and raising error messages/warning.
Thanks
Nitin -
Revision: 15163
Revision: 15163
Author: [email protected]
Date: 2010-03-31 06:31:12 -0700 (Wed, 31 Mar 2010)
Log Message:
Bug: BLZ-507 - JGroups 2.9.0 GA not compatible with BlazeDS/LCDS
QA: Yes
Doc: No
Checkintests: Pass
Details: Tweaked the clustering code to work with JGroups 2.9.0 while maintaining backwards compatibility with earlier versions of JGroups.
Ticket Links:
http://bugs.adobe.com/jira/browse/BLZ-507
Modified Paths:
blazeds/trunk/modules/core/src/flex/messaging/cluster/ClusterNode.java
blazeds/trunk/modules/core/src/flex/messaging/cluster/JGroupsCluster.java -
JBO-25005: Object name 1 for type Variable is invalid(help please)
Hi Guys,
when i connect my application to the DB locally, everything works fine. however, once i deploy my application to the server by connecting to the same DB, i tried 10 users which i already tested loaclly and work fine,
i got the following problem:
all of 10 users are able to access to any pages on the web application, except when one of the users tries can not access one specific page, i got the following error:
500 Internal Server Error
JBO-30003: The application pool (ca.bluecross.ab.eca.model.services.ECAServiceLocal) failed to checkout an application module due to the following exceptionracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.InvalidObjNameException, msg=JBO-25005: Object name 1 for type Variable is invalid at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002) at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1998) at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793) at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453) at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:233) at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424) at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:419) at oracle.adf.model.bc4j.DCJboDataControl.rebuildApplicationModule(DCJboDataControl.java:1517) at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1381) at oracle.adf.model.BindingContext.beginRequest(BindingContext.java:683) at oracle.adf.model.BindingRequestHandler.invokeBeginRequest(BindingRequestHandler.java:349) at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:166) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:161) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:313) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:199) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)## Detail 0 ##oracle.jbo.InvalidObjNameException: JBO-25005: Object name 1 for type Variable is invalid at oracle.jbo.common.VariableImpl.validateName(VariableImpl.java:234) at oracle.jbo.common.VariableImpl.setVariableKind(VariableImpl.java:301) at oracle.jbo.server.ViewObjectImpl.activateParams(ViewObjectImpl.java:13417) at oracle.jbo.server.ViewObjectImpl.doActivateSettings(ViewObjectImpl.java:13479) at oracle.jbo.server.ViewObjectImpl.doActivateSettings(ViewObjectImpl.java:13328) at oracle.jbo.server.ApplicationModuleImpl.activateVOs(ApplicationModuleImpl.java:7181) at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:6981) at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6960) at oracle.jbo.server.Serializer.activate(Serializer.java:274) at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330) at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5549) at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:178) at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:7777) at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4074) at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2161) at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1961) at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1998) at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793) at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453) at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:233) at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424) at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:419) at oracle.adf.model.bc4j.DCJboDataControl.rebuildApplicationModule(DCJboDataControl.java:1517) at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1381) at oracle.adf.model.BindingContext.beginRequest(BindingContext.java:683) at oracle.adf.model.BindingRequestHandler.invokeBeginRequest(BindingRequestHandler.java:349) at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:166) at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:161) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:313) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:199) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)
please help, i am stuck for days.
Thank you"Let me understand more about this.
Does this happen always only with one user or username?
Does this happen only when he/she accesses a particular page?"
it happens only with one user when she/he accesses a particular page -
Flex - BlazeDS - Java: int are set to 0 when they should be kept to NULL.
Hi everyone, I'm having an issue with Flex -> BlazeDS -> Java.
When I pass an object to Java through BlazeDS, my variables of type int are automatically set to 0 if they are NULL or NAN. Is there a way to keep them as NULL ?
Thanks everyone.Please refer to --
https://bugs.adobe.com/jira/browse/BLZ-305 -
Problem with view object for global variables
Hi,
I'm using jdeveloper 11.1.2.3.0
We are using view object with transient attributes for global variables.
we defined the view as explained here:
http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
also we defined one of the attributes as primary key.
When we start to test our application with disable connection pooling we got some problems.
sometimes the row in the global view object is deleted.
(for example after using executeEmptyRowSet on other view object).
it looks strange, we couldn't fוnd why does it happen.
Any idea?As Timo said, it is very hard to help without source.
Are you sure that you do the next step:
After the call to super.prepareSession(), add code to create a new row in the transient view object and insert it into the view object. -
Af:selectManyChoice transient variable to show selected rec in edit mode
Hi All,
Previous i have asked about af:selectManyChoice.
My requirement i have two tables HeadTab and ChildTab.
In my jsff , am showing HeadTab in table grid .In HeadTabVO , i have created a transient variable named chDetail.
In table grid , am using af:selectManyChoice to chDetail , where user select multiple records. I can successful in get the selected records and saving in the ChildTab.
Issue : when am in edit mode or revisit the page . Now i need to show the selected /saved records for respective HeadTab Id in chDetail (af:selectManyChoice) .
I have created view link to HeadTab and ChildTab. How can i show the existing record in selected manner in chDetail transient variable for respective IDs in HeadTab.
Thanks in advance.Frank,
I'm saving selected records in ChildTab . when user revisits /edit mode , i have to show the records which are saved in ChildTab as selected in the af:selectManyChoice(this is transient variable) .I'm using jspx page.
Edited by: user9010551 on Nov 5, 2012 9:08 PM
Maybe you are looking for
-
Specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
After reading a bit about JavaFX Script (which is actually remarkebly close to ActionScript 3) as a developer I thought the way one can specify the GUI declaratively in JavaFX Script via JSON-like notation for the components is pretty cool. It would
-
Sync windows Address Book...
On itunes, it says I can sync my contacts from my windows address book onto my ipod nano (2nd gen.)...well how exactly do I do this? do I need to download something extra to do it? thanks a lot
-
I have a white 2 GB iPod Nano 1st Generation and I want to be able to play my iPod through my car speakers. I already have the USB cable and the car charger, can i just plug the cable & the charger into my car and then turn off my radio and press pla
-
I Have 2 screens to Develop. 1st screen which is Normal screen has 3 fields... Based on the selection iam populating the records in the 2nd screen's Table control. I want to populate the subscreen which holds the input values of the first screen in t
-
My iphone 5, with iOS 7.0.2, is heating and consuming the battery very fast when 3G is on, even when I'm not using it. Any solution?