About Me

My photo
India
Hey there, lovely people! I'm Hemant Menaria, and I'm passionate about programming. Having completed my MCA in 2011, I've delved into the world of coding with fervor. I believe in sharing knowledge, making complex concepts easy to grasp for everyone. JAVA, PHP, and ANDROID hold a special place in my heart, and I spend most of my time immersed in them. Currently, I'm deeply engaged in API/Webservice frameworks and crafting Hybrid mobile applications to enhance flexibility in the digital realm. If you ever find yourself stuck with a programming challenge, feel free to reach out to me at +91-8955499900 or drop me a line at hemantmenaria008@gmail.com. I'm always eager to help fellow enthusiasts navigate the intricacies of coding!

Sunday, November 7, 2021

Apache Cordova app issues

Here I am sharing all the issues/errors which I get during Cordova mobile app development-

1-Call to undefined method mysqli_stmt::get_result

Solution: https://stackoverflow.com/questions/8321096/call-to-undefined-method-mysqli-stmtget-result

cpanel dispable mysqli and enable nd_mysqli


2- Server origin access issue  (Unable to access API hosted on server)

   v1=> .htaccess => added following lines

<IfModule mod_headers.c>

    Header set Access-Control-Allow-Origin "*"

</IfModule>


3- Emulator : net not working. 

   First change DNS to 8.8.8.8 of the computer where avd running.

   Now open android studio=> tools=>AVD manager=> select drop down arrow of the AVD(Emulator)=> click on "Cold Boot Now"


4- Add platform: cordova platform add android

                 cordova platform rm android

cordova platform add browser


5- Run app into emulator:

cordova build --emulator

cordova run android --emulator

To run in mobile-> cordova run or cordova run android

To browser  cordova run browser


6- Biggest Issue: 

i) Why am I seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors in cordova 8/9.....?

        ii) was unable to call API using jquery ajax : Error was cordova app ajax api call returning xhr.status 0

Solution: go to config.xml

<widget id="com.my.awesomeapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets"

xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">

this line already in config.xml but here you can see xmln:android  not there so just copy xmlns:android="http://schemas.android.com/apk/res/android" 

and past it there.

now past below <edit-config....>....</edit-config> into <plateform name="android"> ..../<platform> section.

<platform name="android">

  <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">

      <application android:usesCleartextTraffic="true" />

  </edit-config>

</platform>

for more details please check https://stackoverflow.com/questions/54752716/why-am-i-seeing-neterr-cleartext-not-permitted-errors-after-upgrading-to-cordo


7- Issue : if you want to use <script> in .html file then need to add follwoing

 <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' http://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'" />

Saturday, November 6, 2021

How to analyze windows event log

 

Open windows event viewer-

1- Open Control Panel.

2- Click on Administrative Tools.

3- Now open Event Viewer.

In the console tree, expand Windows Logs, and then click System. The results pane lists individual system events.

Now before proceeding further we should know the event id of the event which we want to analyze. here we want to check system shut down, reboot, start etct so event id is given below-

Event ID 41: The system rebooted without cleanly shutting down first. This error occurs when the system stopped responding, crashed, or lost power unexpectedly.

Event ID 1074: Indicates that the shut down process was initiated by an app or user, or when a user initiates a restart or shutdown. Your computer records this event when an application forces your laptop to shut down or restart. This event also helps you know when a user restarted or shut down the computer from the Start menu or by using CTRL+ALT+DEL.

Event ID 6006 - The clean shut down event. This means Windows 10 was turned off correctly.  It gives the message, “The Event log service was stopped.”

Event ID 6008 - Indicates a dirty/improper shutdown. Appears in the log when the previous shutdown was unexpected, e.g. due to power loss or BSoD (Bug check).you  will see this event in your system log. It gives the message, “The previous system shutdown at time on date was unexpected.”


After this, we can find the particular event by Option "Filter Current logs" in the right side action tab and you can see all the logs with time for that particular event. 

If you want to see more details about a specific event, in the results pane, click the event.



Thursday, June 17, 2021

Oracle Network Adapter Could Not Establish The Connection Error

 

The Network Adapter Could Not Establish The Connection Error in oracle.


Hey guys! Have you ever faced the TNS IO error saying “The network adapter could not establish the connection”? when you are trying to make a new connection in SQL Developer or logging on to the database using SQL*Plus editor. If yes then you are at the right place because here in this blog I am going to show you how you can solve this error. 



So without further ado let’s proceed to solve this badass TNS error.

Step 1: Make sure your entries are correct

First of all to solve “The network adapter could not establish the connection” error, check whether you have entered the correct username and password as well as the correct Hostname and Port number. Though these are small things we cannot avoid them. After all “It’s the small things in a relationship that means the most.” 

[bctt tweet=”How to solve “The network adapter could not establish the connection” error in just 2 steps” username=”RebellionRider”]

For the valid hostname and port number, you can check the Listener.ora if you have access to your server as the listener is a server process. In case you don’t have access to listener.ora file then you can check the tnsnames.ora file.

In case of Listener.ora file check for Host and Port entry in Listener tag for valid hostname and port number.

Listener.ora

And if you are using TNSnames.ora file for validating the hostname and port number then search for the entry which has the same name as your SID and then check for host and port number entry in that particular tag.

                                                        TNSnames.ora

Now try connecting. If this solves your problem then you can avoid the next step. But if “The network adapter could not establish the connection” error is still there, then don’t worry just follow the next step.

 

Step 2: Is your listener taking a rest?

If your problem is still there and you haven’t gotten rid of that nasty error then there is a possibility that your Listener is not running. To check whether Listener is up and running or not, simply open up your command prompt with Administrative privileges and Write 

C:\> lsnrctl status

This command will show you the status of your listener. If the output of this command looks like the one shown in the picture below then it clearly means your listener is not running thus next what you have to do is to start the listener. 



To start the listener you just have to write

C:\> lsnrctl start.

This will start your listener and most probably solve your problem.

Info Byte:
In case you are hav ing problems in starting your listener then try starting “OracleOraDb11g_home1TNSListener” windows service. For that open your Run Command and write services.msc this will open your service panel. Here search for the same and right click to start it.

Special thanks to Mr. Manish Sharma http://www.rebellionrider.com/  for above information.

Forget oracle database username or password

 

Forget oracle database username or password

Recover oracle database username and password


Step-1: open sqlplus.

Step-2: type- connect / as sysdba   and password will be blank so just enter.

Step-3: Now you can see SQL> 

Step-4: To get all user type following query-

    SQL> select username,password from dba_users;

now find the user which you have created from the shown list and reset password by following query-

    SQL> alter user username identified by password;

Here username is the user for which you want to reset the password.


Create new user-

Step-1: open sqlplus.

Step-2: type- connect / as sysdba   and password will be blank so just enter.

Step-3: Now you can see SQL> 

Step-4 :To create new user type following query-

create user NewUserName identified by password

note: if you get "create user invalid common user or role name" error then just change the session by type following query-

    alter session set "_ORACLE_SCRIPT"=true;   

and try again to create user by step-4.

Step-5: Grant Previlage to oracle user (With DBA power)-

    GRANT CONNECT, RESOURCE, DBA TO NewUserName;

To grant all role to user-

    GRANT ALL PRIVILEGES TO NewUserName;